8000 Bump test coverage in fields: cover datatype and role attributes (#64) · parino/document-api-python@7041c9e · GitHub
[go: up one dir, main page]

Skip to content

Commit 7041c9e

Browse files
authored
Bump test coverage in fields: cover datatype and role attributes (tableau#64)
* Bump test coverage up a bit in fields * Fix pep8 violation, and it fixed a few other things automatically as well
1 parent 44ca620 commit 7041c9e

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/test_datasource.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020

2121
class DataSourceFieldsTDS(unittest.TestCase):
22+
2223
def setUp(self):
2324
self.ds = Datasource.from_file(TEST_TDS_FILE)
2425

@@ -51,21 +52,31 @@ def test_datasource_field_is_quantitative(self):
5152
def test_datasource_field_is_ordinal(self):
5253
self.assertTrue(self.ds.fields['[x]'].is_ordinal)
5354

55+
def test_datasource_field_datatype(self):
56+
self.assertEqual(self.ds.fields['[x]'].datatype, 'integer')
57+
58+
def test_datasource_field_role(self):
59+
self.assertEqual(self.ds.fields['[x]'].role, 'measure')
60+
5461

5562
class DataSourceFieldsTWB(unittest.TestCase):
63+
5664
def setUp(self):
5765
self.wb = Workbook(TEST_TWB_FILE)
58-
self.ds = self.wb.datasources[0] # Assume the first datasource in the file
66+
# Assume the first datasource in the file
67+
self.ds = self.wb.datasources[0]
5968

6069
def test_datasource_fields_loaded_in_workbook(self):
6170
self.assertIsNotNone(self.ds.fields)
6271
self.assertIsNotNone(self.ds.fields.get('[Number of Records]', None))
6372

6473

6574
class DataSourceFieldsFoundIn(unittest.TestCase):
75+
6676
def setUp(self):
6777
self.wb = Workbook(TEST_TWB_FILE)
68-
self.ds = self.wb.datasources[0] # Assume the first datasource in the file
78+
# Assume the first datasource in the file
79+
self.ds = self.wb.datasources[0]
6980

7081
def test_datasource_fields_found_in_returns_fields(self):
7182
actual_values = self.ds.fields.used_by_sheet('Sheet 1')

0 commit comments

Comments
 (0)
0