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