Exemplo n.º 1
0
 def __init__(self, default_repo, repos, name=None, **kwargs):
   super(PublishConfiguration, self).__init__(name=name,
                                              default_repo=addressable(Exactly(Configuration),
                                                                       default_repo),
                                              repos=addressable_mapping(Exactly(Configuration),
                                                                        repos),
                                              **kwargs)
Exemplo n.º 2
0
 def __init__(self, default_repo, repos, name=None, **kwargs):
     super(PublishConfiguration,
           self).__init__(name=name,
                          default_repo=addressable(Exactly(Configuration),
                                                   default_repo),
                          repos=addressable_mapping(Exactly(Configuration),
                                                    repos),
                          **kwargs)
Exemplo n.º 3
0
 def test_mixed(self):
     self.assertEqual(
         dict(meaning_of_life=42,
              fine_structure_constant=Addressed(SubclassesOf((int, float)),
                                                '//:fsc')),
         addressable_mapping(
             SubclassesOf((int, float)),
             dict(meaning_of_life=42, fine_structure_constant='//:fsc')))
Exemplo n.º 4
0
 def test_pointers(self):
   self.assertEqual(dict(meaning_of_life=Addressed(Exactly(int), '//:meaning-of-life')),
                    addressable_mapping(Exactly(int), dict(meaning_of_life='//:meaning-of-life')))
Exemplo n.º 5
0
 def test_values(self):
   self.assertEqual(dict(meaning_of_life=42, fine_structure_constant=1 / 137.0),
                    addressable_mapping(SubclassesOf((int, float)),
                                        dict(meaning_of_life=42,
                                             fine_structure_constant=1 / 137.0)))
Exemplo n.º 6
0
 def test_none(self):
   self.assertEqual({}, addressable_mapping(Exactly(int), None))
Exemplo n.º 7
0
 def test_type_mismatch(self):
   with self.assertRaises(AddressedError):
     addressable_mapping(Exactly(int), dict(meaning_of_life=42, fine_structure_constant=1 / 137.0))
Exemplo n.º 8
0
 def test_mixed(self):
   self.assertEqual(dict(meaning_of_life=42,
                         fine_structure_constant=Addressed(SubclassesOf((int, float)), '//:fsc')),
                    addressable_mapping(SubclassesOf((int, float)),
                                        dict(meaning_of_life=42,
                                             fine_structure_constant='//:fsc')))
Exemplo n.º 9
0
 def test_values(self):
     self.assertEqual(
         dict(meaning_of_life=42, fine_structure_constant=1 / 137.0),
         addressable_mapping(
             SubclassesOf((int, float)),
             dict(meaning_of_life=42, fine_structure_constant=1 / 137.0)))
Exemplo n.º 10
0
 def test_none(self):
     self.assertEqual({}, addressable_mapping(Exactly(int), None))
Exemplo n.º 11
0
 def test_type_mismatch(self):
     with self.assertRaises(AddressedError):
         addressable_mapping(
             Exactly(int),
             dict(meaning_of_life=42, fine_structure_constant=1 / 137.0))
Exemplo n.º 12
0
 def test_pointers(self):
     self.assertEqual(
         dict(
             meaning_of_life=Addressed(Exactly(int), '//:meaning-of-life')),
         addressable_mapping(Exactly(int),
                             dict(meaning_of_life='//:meaning-of-life')))