예제 #1
0
파일: views.py 프로젝트: duthils/greglink
def test_failed(path):
    testcase = find_test(path)
    if not testcase:
        return ("Test not found", 404)

    models.save_failed(testcase)
    return redirect('/')
예제 #2
0
    def test_find_test_file_does_not_exist(self, os_exists, path_to_filepath):
        path = "/foo/bar.md"
        filepath = "/root/foo/bar.md"

        os_exists.return_value = False
        path_to_filepath.return_value = filepath

        expected = None
        result = loading.find_test(path)

        os_exists.assert_called_once_with(filepath)
        self.assertEquals(result, expected)
예제 #3
0
    def test_find_test(self, load_test, os_exists, path_to_filepath):
        path = "/foo/bar.md"
        filepath = "/root/foo/bar.md"

        testcase = Mock()
        load_test.return_value = testcase
        os_exists.return_value = True
        path_to_filepath.return_value = filepath

        result = loading.find_test(path)

        load_test.assert_called_once_with(path, filepath)
        self.assertEquals(result, testcase)
예제 #4
0
파일: views.py 프로젝트: duthils/greglink
def execute_test(path):
    testcase = find_test(path)
    if not testcase:
        return ("Test not found", 404)

    return render_template('execute_test.html', testcase=testcase)