Beispiel #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)
Beispiel #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)
Beispiel #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')))
Beispiel #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')))
Beispiel #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)))
Beispiel #6
0
 def test_none(self):
   self.assertEqual({}, addressable_mapping(Exactly(int), None))
Beispiel #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))
Beispiel #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')))
Beispiel #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)))
Beispiel #10
0
 def test_none(self):
     self.assertEqual({}, addressable_mapping(Exactly(int), None))
Beispiel #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))
Beispiel #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')))