Example #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)
Example #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)
Example #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)
Example #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))
Example #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)
Example #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)
Example #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)