def test_identifiers(self):
     self.create_config_file(self.tempfile, {
         "Iron Man": {},
         "Whiplash": {},
     })
     cfbs = ConfigFileBackingStore(self.tempfile)
     self.assertEquals(cfbs.identifiers(), ["Iron Man", "Whiplash"])
 def test_identifiers(self):
   self.create_config_file(self.tempfile, {
       "Iron Man": {},
       "Whiplash": {},
   })
   cfbs = ConfigFileBackingStore(self.tempfile)
   self.assertEquals(cfbs.identifiers(), ["Iron Man", "Whiplash"])
 def test_config_file_backing_store_can_read_saved_file(self):
   cfbs = ConfigFileBackingStore(self.tempfile)
   cfbs.add_identifier("Iron Man")
   cfbs.set("Iron Man", "alignment", "good")
   cfbs.add_identifier("Whiplash")
   cfbs.set("Whiplash", "alignment", "evil")
   cfbs.save()
   new_cfbs = ConfigFileBackingStore(self.tempfile)
   self.assertIn("Iron Man", new_cfbs.identifiers())
   self.assertIn("Whiplash", new_cfbs.identifiers())
   self.assertEquals("good", new_cfbs.get("Iron Man", "alignment"))
   self.assertEquals("evil", new_cfbs.get("Whiplash", "alignment"))
Beispiel #4
0
 def test_config_file_backing_store_can_read_saved_file(self):
     cfbs = ConfigFileBackingStore(self.tempfile)
     cfbs.add_identifier("Iron Man")
     cfbs.set("Iron Man", "alignment", "good")
     cfbs.add_identifier("Whiplash")
     cfbs.set("Whiplash", "alignment", "evil")
     cfbs.save()
     new_cfbs = ConfigFileBackingStore(self.tempfile)
     self.assertIn("Iron Man", new_cfbs.identifiers())
     self.assertIn("Whiplash", new_cfbs.identifiers())
     self.assertEqual("good", new_cfbs.get("Iron Man", "alignment"))
     self.assertEqual("evil", new_cfbs.get("Whiplash", "alignment"))
 def test_remove_identifier_does_nothing_when_identifer_dne(self):
   self.create_config_file(self.tempfile, {})
   cfbs = ConfigFileBackingStore(self.tempfile)
   self.assertNotIn("Iron Man", cfbs.identifiers())
   cfbs.remove_identifier("Iron Man")
   self.assertNotIn("Iron Man", cfbs.identifiers())
 def test_removed_identifiers_dont_show_up_in_subsequent_calls(self):
   self.create_config_file(self.tempfile, {"Iron Man": {}})
   cfbs = ConfigFileBackingStore(self.tempfile)
   cfbs.remove_identifier("Iron Man")
   self.assertNotIn("Iron Man", cfbs.identifiers())
 def test_added_identifiers_show_up_in_subsequent_calls(self):
   self.create_config_file(self.tempfile, {})
   cfbs = ConfigFileBackingStore(self.tempfile)
   cfbs.add_identifier("Iron Man")
   self.assertIn("Iron Man", cfbs.identifiers())
 def test_empty_file(self):
   self.create_config_file(self.tempfile, {})
   cfbs = ConfigFileBackingStore(self.tempfile)
   self.assertEquals(cfbs.identifiers(), [])
Beispiel #9
0
 def test_remove_identifier_does_nothing_when_identifer_dne(self):
     self.create_config_file(self.tempfile, {})
     cfbs = ConfigFileBackingStore(self.tempfile)
     self.assertNotIn("Iron Man", cfbs.identifiers())
     cfbs.remove_identifier("Iron Man")
     self.assertNotIn("Iron Man", cfbs.identifiers())
Beispiel #10
0
 def test_removed_identifiers_dont_show_up_in_subsequent_calls(self):
     self.create_config_file(self.tempfile, {"Iron Man": {}})
     cfbs = ConfigFileBackingStore(self.tempfile)
     cfbs.remove_identifier("Iron Man")
     self.assertNotIn("Iron Man", cfbs.identifiers())
Beispiel #11
0
 def test_added_identifiers_show_up_in_subsequent_calls(self):
     self.create_config_file(self.tempfile, {})
     cfbs = ConfigFileBackingStore(self.tempfile)
     cfbs.add_identifier("Iron Man")
     self.assertIn("Iron Man", cfbs.identifiers())
Beispiel #12
0
 def test_empty_file(self):
     self.create_config_file(self.tempfile, {})
     cfbs = ConfigFileBackingStore(self.tempfile)
     self.assertEqual(cfbs.identifiers(), [])