コード例 #1
0
    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
コード例 #2
0
    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'
        }
コード例 #3
0
    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') == {}