def test_layer_without_keywords(self): """Test load state from keywords works""" myDialog = KeywordsDialog(PARENT, IFACE) myLayer = make_keywordless_layer() myDialog.layer = myLayer myDialog.load_state_from_keywords() myKeywords = myDialog.get_keywords() #check that a default title is given (see #https://github.com/AIFDR/inasafe/issues/111) myExpectedKeywords = { 'category': 'exposure', 'title': 'Keywordless Layer'} myMessage = ('\nGot: %s\nExpected: %s\n' % (myKeywords, myExpectedKeywords)) assert myKeywords == myExpectedKeywords, myMessage
def test_load_state_from_keywords(self): """Test load state from keywords works""" dialog = KeywordsDialog(PARENT, IFACE) layer = make_padang_layer() dialog.layer = layer dialog.load_state_from_keywords() keywords = dialog.get_keywords() expected_keywords = { 'title': 'An earthquake in Padang like in 2009', 'category': 'hazard', 'source': 'USGS', 'subcategory': 'earthquake', 'unit': 'MMI'} self.assertEqual(keywords, expected_keywords)
def test_loadStateFromKeywords(self): """Test load state from keywords works""" myDialog = KeywordsDialog(PARENT, IFACE) myLayer = makePadangLayer() myDialog.layer = myLayer myDialog.load_state_from_keywords() myKeywords = myDialog.get_keywords() myExpectedKeywords = {'title': 'An earthquake in Padang like in 2009', 'category': 'hazard', 'source': 'USGS', 'subcategory': 'earthquake', 'unit': 'MMI'} myMessage = ('\nGot:\n%s\nExpected:\n%s\n' % (myKeywords, myExpectedKeywords)) assert myKeywords == myExpectedKeywords, myMessage
def test_load_state_from_keywords(self): """Test load state from keywords works""" dialog = KeywordsDialog(PARENT, IFACE) layer = make_padang_layer() dialog.layer = layer dialog.load_state_from_keywords() keywords = dialog.get_keywords() expected_keywords = { 'title': 'An earthquake in Padang like in 2009', 'category': 'hazard', 'source': 'USGS', 'subcategory': 'earthquake', 'unit': 'MMI' } self.assertEqual(keywords, expected_keywords)
def test_layer_without_keywords(self): """Test load state from keywords works""" myDialog = KeywordsDialog(PARENT, IFACE) myLayer = make_keywordless_layer() myDialog.layer = myLayer myDialog.load_state_from_keywords()
def test_layer_without_keywords(self): """Test load state from keywords works""" myDialog = KeywordsDialog(PARENT, IFACE) myLayer = make_keywordless_layer() myDialog.layer = myLayer myDialog.load_state_from_keywords()