def test_get_question_returns_a_copy(self, read_yaml_mock): self.set_read_yaml_mock_response(read_yaml_mock) yaml_loader = ContentLoader('anything.yml', 'content/') q1 = yaml_loader.get_question('question1') q1["id"] = "modified" q1["depends"] = [] assert yaml_loader.get_question('question1') != q1
def test_get_question(self, read_yaml_mock): self.set_read_yaml_mock_response(read_yaml_mock) yaml_loader = ContentLoader('anything.yml', 'content/') assert yaml_loader.get_question('question1') == { 'depends': [{'being': 'SaaS', 'on': 'lot'}], 'name': 'question1', 'id': 'question1' }
def test_get_missing_question(self, read_yaml_mock): self.set_read_yaml_mock_response(read_yaml_mock) yaml_loader = ContentLoader('anything.yml', 'content/') assert yaml_loader.get_question('question111') == {}