def test_get_all_titles(self): self._init_test_data_file() title1 = 'title 1' title2 = 'title 2' item1 = Item(title1) item2 = Item(title2) orgm = Organizem(TEST_DATA_FILE, IS_UNIT_TESTING) orgm.add_item(item1) orgm.add_item(item2) # Have to handle the fact that init of test dat file includes dummy item with "TEST_ITEM" title self.assertTrue(orgm.get_elements(Elem.TITLE) == ['TEST_ITEM', 'title 1', 'title 2'])
def test_get_all_actions(self): self._init_test_data_file() title1 = 'title 1' title2 = 'title 2' actions1 = ['action 1', 'action 2'] actions2 = ['action 3', 'action 4'] item1 = Item(title1, {Elem.ACTIONS : actions1}) item2 = Item(title2, {Elem.ACTIONS : actions2}) orgm = Organizem(TEST_DATA_FILE, IS_UNIT_TESTING) orgm.add_item(item1) orgm.add_item(item2) expected = ['action 1', 'action 2', 'action 3', 'action 4'] actual = orgm.get_elements(Elem.ACTIONS) # Have to handle the fact that init of test dat file includes dummy item with empty name self.assertTrue(expected == actual)
def test_get_all_areas(self): self._init_test_data_file() title1 = 'title 1' title2 = 'title 2' area1 = 'area 1' area2 = 'area 2' item1 = Item(title1, {Elem.AREA : area1}) item2 = Item(title2, {Elem.AREA : area2}) orgm = Organizem(TEST_DATA_FILE, IS_UNIT_TESTING) orgm.add_item(item1) orgm.add_item(item2) expected = ["''", 'area 1', 'area 2'] actual = orgm.get_elements(Elem.AREA) # Have to handle the fact that init of test dat file includes dummy item with empty name self.assertTrue(expected == actual)