From cc98987950094bf1e1c23b7bbc820b54000de0a5 Mon Sep 17 00:00:00 2001 From: surister Date: Sat, 21 Dec 2019 19:24:54 +0100 Subject: [PATCH] Add syntax checker suite unit test --- tests/syntax_checker_unittest.py | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/syntax_checker_unittest.py diff --git a/tests/syntax_checker_unittest.py b/tests/syntax_checker_unittest.py new file mode 100644 index 0000000..7360a1c --- /dev/null +++ b/tests/syntax_checker_unittest.py @@ -0,0 +1,33 @@ +""" +WIP +""" +import unittest +import pathlib + +from tests import * +from scripts import get_answered_questions + + +def open_test_case_file(n: int): + p = pathlib.Path(rf'D:\PycharmProjects\devops-interview-questions\scripts\tests\testcase{n}.md') + + with open(p, 'rb') as f: + file_list = [line.rstrip() for line in f.readlines()] + return file_list + + +class QuestionCount(unittest.TestCase): + solutions = ( + + ) + + def test_count_case_1(self): + raw_list = open_test_case_file(1) + question_list = get_question_list(raw_list) + answers = get_answered_questions.n_answers(question_list) + + self.assertEqual(len(question_list), 21) + self.assertEqual(answers, 2) + + def test_count_case_2(self): + pass \ No newline at end of file