-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from pyqa/compare_utility
Rest Api Tests with complete function coverage
- Loading branch information
Showing
17 changed files
with
172 additions
and
275 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""Example for Comparison module.""" | ||
from imgqa import Compare | ||
|
||
# Variable Stack / Data | ||
image1 = "highway.jpg" | ||
image2 = "highway_altered.jpg" | ||
source_xl = "source.xlsx" | ||
target_xl = "target.xlsx" | ||
source_csv = "source_csv.csv" | ||
target_csv = "target_csv.csv" | ||
source_json = "{'as': 1," \ | ||
"'a': {'b': {'cs':10, 'qqq': {'qwe':1}}," \ | ||
"'d': {'csd':30}}}" | ||
target_json = "{'as': 1," \ | ||
"'a': {'b': {'ds':10, 'qqq': {'qwe':11}}," \ | ||
"'d': {'dsd':40}}}" | ||
|
||
|
||
class TestCompareFiles(Compare): | ||
"""Sample Test Suite.""" | ||
|
||
def test_compare_images(self): | ||
"""Compare images.""" | ||
self.assertEqual(self.compare_images(image1, image1), 1.0) | ||
|
||
def test_compare_jsons(self): | ||
"""Compare jsons.""" | ||
self.assertNotEqual(self.compare_json(source_json, target_json), '{}') | ||
|
||
def test_compare_workbooks(self): | ||
"""Compare spreadsheet. | ||
xl file will be generated with file difference. | ||
""" | ||
self.compare_files(source_xl, target_xl) | ||
|
||
def test_compare_files(self): | ||
"""Compare spreadsheet. | ||
xl file will be generated with file difference. | ||
""" | ||
self.compare_files(source_csv, target_csv) |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions
3
Examples/FilesCompare/second.csv → Examples/FilesCompare/source_csv.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
Year,Industry_aggregation_NZSIOC,Industry_code_NZSIOC,Industry_name_NZSIOC,Units,Variable_code,Variable_name,Variable_category,Value,Industry_code_ANZSIC06 | ||
2017,Level 4,AA111,Horticulture and Fruit Growing,Dollars (millions),H04,"Sales, government funding, grants and subsidies",Financial performance,3999,"ANZSIC06 groups A011, A012, and A013" | ||
2017,Level 4,AA111,Horticulture and Fruit Growing,Dollars (millions),H04,"Sales, government funding, grants and subsidies",Financial performance,3999,"ANZSIC06 groups A011, A012, and A013" | ||
|
||
2017,Level 4,AA111,Horticulture and Fruit Growing,Dollars (millions),H04,"Sales, government funding, grants and subsidies",Financial performance,3999,"ANZSIC06 groups A011, A012, and A013" |
Binary file not shown.
7 changes: 3 additions & 4 deletions
7
Examples/FilesCompare/first.csv → Examples/FilesCompare/target_csv.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
Year,Industry_aggregation_NZSIOC,Industry_code_NZSIOC,Industry_name_NZSIOC,Units,Variable_code,Variable_name,Variable_category,Value,Industry_code_ANZSIC06 | ||
2017,Level 4,AA111,Horticulture and Fruit Growing,Dollars (millions),H04,"Sales, government funding, grants and subsidies",Financial performance,3999,"ANZSIC06 groups A011, A012, and A013" | ||
2016,Level 3,AA111,Horticulture and Fruit Growing,Dollars (millions),H03,"Sales, government funding, grants and subsidies",Financial performance,3998,"ANZSIC06 groups A011, A012, and A014" | ||
|
||
Year,Industry_aggregation_NZSIOC,Industry_code_NZSIOC,Industry_name_NZSIOC,Units,Variable_code,Variable_name,Variable_category,Value,Industry_code_ANZSIC06 | ||
2017,Level 4,AA111,Horticulture and Fruit Growing,Dollars (millions),H04,"Sales, government funding, grants and subsidies",Financial performance,3999,"ANZSIC06 groups A011, A012, and A013" | ||
2016,Level 3,AA111,Horticulture and Fruit Growing,Dollars (millions),H03,"Sales, government funding, grants and subsidies",Financial performance,3998,"ANZSIC06 groups A011, A012, and A014" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.