Ejemplo n.º 1
0
 def test_collision(self):
     a = Config()
     b = Config()
     self.assertEqual(a.collisions(b), {})
     a.A.trait1 = 1
     b.A.trait2 = 2
     self.assertEqual(a.collisions(b), {})
     b.A.trait1 = 1
     self.assertEqual(a.collisions(b), {})
     b.A.trait1 = 0
     self.assertEqual(a.collisions(b),
                      {'A': {
                          'trait1': "1 ignored, using 0",
                      }})
     self.assertEqual(b.collisions(a),
                      {'A': {
                          'trait1': "0 ignored, using 1",
                      }})
     a.A.trait2 = 3
     self.assertEqual(
         b.collisions(a), {
             'A': {
                 'trait1': "0 ignored, using 1",
                 'trait2': "2 ignored, using 3",
             }
         })
Ejemplo n.º 2
0
 def test_collision(self):
     a = Config()
     b = Config()
     self.assertEqual(a.collisions(b), {})
     a.A.trait1 = 1
     b.A.trait2 = 2
     self.assertEqual(a.collisions(b), {})
     b.A.trait1 = 1
     self.assertEqual(a.collisions(b), {})
     b.A.trait1 = 0
     self.assertEqual(a.collisions(b), {
         'A': {
             'trait1': "1 ignored, using 0",
         }
     })
     self.assertEqual(b.collisions(a), {
         'A': {
             'trait1': "0 ignored, using 1",
         }
     })
     a.A.trait2 = 3
     self.assertEqual(b.collisions(a), {
         'A': {
             'trait1': "0 ignored, using 1",
             'trait2': "2 ignored, using 3",
         }
     })
Ejemplo n.º 3
0
 def test_collision(self):
     a = Config()
     b = Config()
     self.assertEqual(a.collisions(b), {})
     a.A.trait1 = 1
     b.A.trait2 = 2
     self.assertEqual(a.collisions(b), {})
     b.A.trait1 = 1
     self.assertEqual(a.collisions(b), {})
     b.A.trait1 = 0
     self.assertEqual(
         a.collisions(b),
         {"A": {
             "trait1": "1 ignored, using 0",
         }},
     )
     self.assertEqual(
         b.collisions(a),
         {"A": {
             "trait1": "0 ignored, using 1",
         }},
     )
     a.A.trait2 = 3
     self.assertEqual(
         b.collisions(a),
         {
             "A": {
                 "trait1": "0 ignored, using 1",
                 "trait2": "2 ignored, using 3",
             }
         },
     )
Ejemplo n.º 4
0
 def test_collision(self):
     a = Config()
     b = Config()
     self.assertEqual(a.collisions(b), {})
     a.A.trait1 = 1
     b.A.trait2 = 2
     self.assertEqual(a.collisions(b), {})
     b.A.trait1 = 1
     self.assertEqual(a.collisions(b), {})
     b.A.trait1 = 0
     self.assertEqual(a.collisions(b), {"A": {"trait1": "1 ignored, using 0"}})
     self.assertEqual(b.collisions(a), {"A": {"trait1": "0 ignored, using 1"}})
     a.A.trait2 = 3
     self.assertEqual(b.collisions(a), {"A": {"trait1": "0 ignored, using 1", "trait2": "2 ignored, using 3"}})