def test_collection_operations_jp(self): collection = SetCollection() set_dict = {"千": ["千葉", "千葉県"], "東": ["東京", "東京都"]} values = {"千葉": "千葉", "千葉県": "千葉県", "東京": "東京", "東京都": "東京都"} collection.add_set("TESTSET", set_dict, "teststore", True, values) set_dict = {"神": ["神奈川", "神戸", "神田"], "大": ["大阪", "大分", "大津"]} values = { "神奈川": "神奈川", "神戸": "神戸", "神田": "神田", "大阪": "大阪", "大分": "大分", "大津": "大津" } collection.add_set("TESTSET2", set_dict, "teststore", True, values) self.assertIsNotNone(collection.sets) self.assertIsNotNone(collection.stores) self.assertTrue(collection.contains("TESTSET")) self.assertTrue(collection.contains("TESTSET2")) self.assertFalse(collection.contains("TESTSET3")) self.assertEqual(collection.store_name("TESTSET"), "teststore") self.assertEqual(collection.store_name("TESTSET2"), "teststore") self.assertIsNone(collection.store_name("TESTSET3")) self.assertTrue(collection.is_cjk("TESTSET")) self.assertTrue(collection.is_cjk("TESTSET2")) self.assertIsNone(collection.is_cjk("TESTSET3")) aset = collection.set_list("TESTSET") self.assertIsNotNone(aset) self.assertEqual(10, collection.count_words_in_sets()) collection.remove("TESTSET2") self.assertTrue(collection.contains("TESTSET")) self.assertFalse(collection.contains("TESTSET2")) self.assertFalse(collection.contains("TESTSET3")) collection.empty() self.assertIsNotNone(collection.sets) self.assertIsNotNone(collection.stores) self.assertFalse(collection.contains("TESTSET")) self.assertIsNone(collection.set_list("TESTSET")) self.assertNotEquals(collection.store_name("TESTSET"), "teststore")
def test_collection_operations(self): collection = SetCollection() collection.add_set("TESTSET", { "A": [["A", "B", "C"]], "D": [["D"]], "E": [["E", "F"]] }, "teststore") collection.add_set("TESTSET2", { "1": [["1", "2", "3"]], "4": [["4"]], "5": [["5", "6"]] }, "teststore") self.assertIsNotNone(collection.sets) self.assertIsNotNone(collection.stores) self.assertTrue(collection.contains("TESTSET")) self.assertTrue(collection.contains("TESTSET2")) self.assertFalse(collection.contains("TESTSET3")) self.assertEqual("teststore", collection.storename("TESTSET")) self.assertIsNone(collection.storename("TESTMAP4")) aset = collection.set("TESTSET") self.assertIsNotNone(aset) self.assertEqual(6, collection.count_words_in_sets()) collection.remove("TESTSET2") self.assertTrue(collection.contains("TESTSET")) self.assertFalse(collection.contains("TESTSET2")) self.assertFalse(collection.contains("TESTSET3")) collection.empty() self.assertIsNotNone(collection.sets) self.assertIsNotNone(collection.stores) self.assertFalse(collection.contains("TESTSET")) self.assertIsNone(collection.set("TESTSET")) self.assertNotEquals(collection.storename("TESTSET"), "teststore")
def test_collection_operations(self): collection = SetCollection() set_dict = { "A": [["A", "A B", "A C"]], "D": [["D"]], "E": [["E", "E F"]] } values = { "A": "A", "A B": "A B", "A C": "A C", "D": "D", "E": "E", "E F": "E F" } collection.add_set("TESTSET", set_dict, "teststore", False, values) set_dict = { "1": [["1", "1 2", "1 3"]], "4": [["4"]], "5": [["5", "5 6"]] } values = { "1": "1", "1 2": "1 2", "1 3": "1 3", "4": "4", "5": "5", "5 6": "5 6" } collection.add_set("TESTSET2", set_dict, "teststore", False, values) self.assertIsNotNone(collection.sets) self.assertIsNotNone(collection.stores) self.assertTrue(collection.contains("TESTSET")) self.assertTrue(collection.contains("TESTSET2")) self.assertFalse(collection.contains("TESTSET3")) self.assertEqual(collection.store_name("TESTSET"), "teststore") self.assertEqual(collection.store_name("TESTSET2"), "teststore") self.assertIsNone(collection.store_name("TESTSET3")) self.assertFalse(collection.is_cjk("TESTSET")) self.assertFalse(collection.is_cjk("TESTSET2")) self.assertIsNone(collection.is_cjk("TESTSET3")) aset = collection.set_list("TESTSET") self.assertIsNotNone(aset) self.assertEqual(12, collection.count_words_in_sets()) collection.remove("TESTSET2") self.assertTrue(collection.contains("TESTSET")) self.assertFalse(collection.contains("TESTSET2")) self.assertFalse(collection.contains("TESTSET3")) collection.empty() self.assertIsNotNone(collection.sets) self.assertIsNotNone(collection.stores) self.assertFalse(collection.contains("TESTSET")) self.assertIsNone(collection.set_list("TESTSET")) self.assertNotEquals(collection.store_name("TESTSET"), "teststore")