def test_save_system_with_node(self):
   system = System("system")
   system.create_node("node")
   system.save()
   retrieved = System.objects.get(name="system")
   self.assertEqual(system, retrieved)
   self.assertEqual(system.nodes, retrieved.nodes)
   self.assertTrue(retrieved.nodes.has_key("node"))
Exemple #2
0
 def test_create_node_twice(self):
   s = System("system")
   n = s.create_node("node")
   self.assertRaises(DuplicateError, s.create_node, "node") 
Exemple #3
0
 def test_delete_node_base(self):
   s = System("system")
   n = s.create_node("node")
   s.delete_node("node")
   self.assertFalse("node" in  s.nodes)
Exemple #4
0
 def test_create_node_base(self):
   s = System("system")
   n = s.create_node("node")
   self.assertEqual(n.name, "node")
   self.assertTrue(n is s.nodes["node"])