コード例 #1
0
ファイル: targets.py プロジェクト: priyakoth/pants
 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)
コード例 #2
0
ファイル: targets.py プロジェクト: youprofit/pants
 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)
コード例 #3
0
ファイル: test_addressable.py プロジェクト: youprofit/pants
 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')))
コード例 #4
0
ファイル: test_addressable.py プロジェクト: priyakoth/pants
 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')))
コード例 #5
0
ファイル: test_addressable.py プロジェクト: priyakoth/pants
 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)))
コード例 #6
0
ファイル: test_addressable.py プロジェクト: priyakoth/pants
 def test_none(self):
   self.assertEqual({}, addressable_mapping(Exactly(int), None))
コード例 #7
0
ファイル: test_addressable.py プロジェクト: priyakoth/pants
 def test_type_mismatch(self):
   with self.assertRaises(AddressedError):
     addressable_mapping(Exactly(int), dict(meaning_of_life=42, fine_structure_constant=1 / 137.0))
コード例 #8
0
ファイル: test_addressable.py プロジェクト: priyakoth/pants
 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')))
コード例 #9
0
ファイル: test_addressable.py プロジェクト: youprofit/pants
 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)))
コード例 #10
0
ファイル: test_addressable.py プロジェクト: youprofit/pants
 def test_none(self):
     self.assertEqual({}, addressable_mapping(Exactly(int), None))
コード例 #11
0
ファイル: test_addressable.py プロジェクト: youprofit/pants
 def test_type_mismatch(self):
     with self.assertRaises(AddressedError):
         addressable_mapping(
             Exactly(int),
             dict(meaning_of_life=42, fine_structure_constant=1 / 137.0))
コード例 #12
0
ファイル: test_addressable.py プロジェクト: youprofit/pants
 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')))