예제 #1
0
    def test_32_find__maybe_file(self):
        self.assertEqual(TT.find("/path/to/a.jsn", PRS), A3)
        self.assertEqual(TT.find("../../path/to/b.yml", PRS), B)

        obj = anyconfig.ioinfo.make("/path/to/a.json")
        self.assertEqual(TT.find(obj, PRS), A3)
예제 #2
0
 def test_34_find__type_or_id(self):
     self.assertEqual(TT.find(None, PRS, forced_type="json"), A3)
     self.assertEqual(TT.find(None, PRS, forced_type="yaml"), B)
     self.assertEqual(TT.find(None, PRS, forced_type="dummy"), C)
예제 #3
0
 def test_30_find__forced_type(self):
     self.assertEqual(TT.find(None, PRS, forced_type=A2), A2)
     self.assertEqual(TT.find(None, PRS, forced_type=A2()), A2)
     self.assertEqual(TT.find(None, PRS, forced_type=C.cid()), C)
예제 #4
0
 def test_52_find__with_forced_type(self):
     self.assertTrue(isinstance(TT.find(None, PRS, forced_type=A2), A2))
     self.assertTrue(isinstance(TT.find(None, PRS, forced_type=A2()), A2))
예제 #5
0
 def test_34_find__type_or_id(self):
     self.assertEqual(TT.find(None, PRS, forced_type="json"), A3)
     self.assertEqual(TT.find(None, PRS, forced_type="yaml"), B)
     self.assertEqual(TT.find(None, PRS, forced_type="dummy"), C)
예제 #6
0
    def test_32_find__maybe_file(self):
        self.assertEqual(TT.find("/path/to/a.jsn", PRS), A3)
        self.assertEqual(TT.find("../../path/to/b.yml", PRS), B)

        obj = anyconfig.ioinfo.make("/path/to/a.json")
        self.assertEqual(TT.find(obj, PRS), A3)
예제 #7
0
 def test_30_find__forced_type(self):
     self.assertEqual(TT.find(None, PRS, forced_type=A2), A2)
     self.assertEqual(TT.find(None, PRS, forced_type=A2()), A2)
     self.assertEqual(TT.find(None, PRS, forced_type=C.cid()), C)