示例#1
0
    def test_load_dict_json(self, tmpdir):
        a_dict = {'a': 'dict'}
        path = os.path.join(tmpdir, 'a.json')
        with open(path, 'w') as json_file:
            json.dump(a_dict, json_file)

        returned = functional._load_dict(path)

        assert returned == a_dict
示例#2
0
    def test_load_dict_none(self):
        returned = functional._load_dict(None)

        assert returned is None
示例#3
0
    def test_load_dict_dict(self):
        a_dict = {'a': 'dict'}
        returned = functional._load_dict(a_dict)

        assert returned is a_dict