def test_checkIllegalImportsFails(self):
        commit = PreCommit(None, None)
        file = open('./resources/illegal-java-files/IllegalImport.java', 'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(ILLEGAL_IMPORT_MSG, actual)
示例#2
0
    def test_checkIllegalImportsFails(self):
        commit = PreCommit(None, None)
        file = open('./resources/illegal-java-files/IllegalImport.java', 'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(ILLEGAL_IMPORT_MSG, actual)
示例#3
0
    def test_checkFileFailsForTestSetupPause(self):
        commit = PreCommit(None, None)
        file = open('./resources/illegal-java-files/Attribute.java', 'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(PAUSE_IN_JAVA_FILE_MSG, actual)
示例#4
0
    def test_checkIllegalSoloTestDartFile(self):
        commit = PreCommit(None, None)
        file = open('./resources/illegal-dart-files/IllegalDartTest2.dart',
                    'r')
        actual = commit.checkFile(file.read().splitlines())

        self.assertEqual(SOLO_TEST_MSG, actual)
    def test_checkIntelliJFormFails(self):
        commit = PreCommit(None, None)
        file = open('./resources/illegal-form-files/AttributePropertiesDialog.form', 'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(INTELLIJ_FORM_WITH_INVALID_REFERENCE_MSG, actual)
    def test_checkFileIgnoresCommentedLineNotStartingWithForwardSlash(self):
        commit = PreCommit(None, None)
        file = open('./resources/clean-java-files/CommentedLineNotStartingWithForwardSlash.java', 'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(None, actual)
    def test_checkFileFailsWhenOutsideCommentedBlock(self):
        commit = PreCommit(None, None)
        file = open('./resources/illegal-java-files/OutsideCommentedBlock.java', 'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(PAUSE_IN_JAVA_FILE_MSG, actual)
    def test_checkIntelliJForm(self):
        commit = PreCommit(None, None)
        file = open('./resources/clean-form-files/AttributePropertiesDialog.form', 'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(None, actual)
    def test_checkFileFailsForTestBasePause(self):
        commit = PreCommit(None, None)
        file = open('./resources/illegal-java-files/AttributeWithTestBasePause.java', 'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(PAUSE_IN_JAVA_FILE_MSG, actual)
示例#10
0
    def test_checkFileFailsForFunctionTestWithPause(self):
        commit = PreCommit(None, None)
        file = open('./resources/illegal-java-files/TutorialTextConditions.java', 'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(PAUSE_IN_JAVA_FILE_MSG, actual)
示例#11
0
    def test_checkFileIgnoresCommentedBlock(self):
        commit = PreCommit(None, None)
        file = open('./resources/clean-java-files/CommentedBlock.java', 'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(None, actual)
示例#12
0
    def test_checkFileIgnoresCommentedBlock(self):
        commit = PreCommit(None, None)
        file = open('./resources/clean-java-files/CommentedBlock.java', 'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(None, actual)
示例#13
0
    def test_checkIntelliJForm(self):
        commit = PreCommit(None, None)
        file = open(
            './resources/clean-form-files/AttributePropertiesDialog.form', 'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(None, actual)
示例#14
0
    def test_checkFileFailsForFunctionTestWithPause(self):
        commit = PreCommit(None, None)
        file = open(
            './resources/illegal-java-files/TutorialTextConditions.java', 'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(PAUSE_IN_JAVA_FILE_MSG, actual)
示例#15
0
    def test_checkFileFailsWhenOutsideCommentedBlock(self):
        commit = PreCommit(None, None)
        file = open(
            './resources/illegal-java-files/OutsideCommentedBlock.java', 'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(PAUSE_IN_JAVA_FILE_MSG, actual)
示例#16
0
    def test_checkIntelliJFormFails(self):
        commit = PreCommit(None, None)
        file = open(
            './resources/illegal-form-files/AttributePropertiesDialog.form',
            'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(INTELLIJ_FORM_WITH_INVALID_REFERENCE_MSG, actual)
示例#17
0
    def test_checkFileIgnoresCommentedLineNotStartingWithForwardSlash(self):
        commit = PreCommit(None, None)
        file = open(
            './resources/clean-java-files/CommentedLineNotStartingWithForwardSlash.java',
            'r')
        javaClass = file.read().splitlines()
        actual = commit.checkFile(javaClass)

        self.assertEqual(None, actual)
示例#18
0
    def test_checkIllegalSoloTestJSFile(self):
        commit = PreCommit(None, None)
        file = open('./resources/illegal-js-files/IllegalJsSpec2.js', 'r')
        actual = commit.checkFile(file.read().splitlines())

        self.assertEqual(SOLO_TEST_MSG, actual)
示例#19
0
    def test_checkFile(self):
        commit = PreCommit(None, None)
        file = open('./resources/clean-java-files/Attribute.java', 'r')
        actual = commit.checkFile(file.read())

        self.assertEqual(None, actual)
示例#20
0
    def test_checkJSFile(self):
        commit = PreCommit(None, None)
        file = open('./resources/clean-js-files/jsSpec.js', 'r')
        actual = commit.checkFile(file.read().splitlines())

        self.assertEqual(None, actual)
示例#21
0
    def test_checkJSFile(self):
        commit = PreCommit(None, None)
        file = open('./resources/clean-js-files/jsSpec.js', 'r')
        actual = commit.checkFile(file.read().splitlines())

        self.assertEqual(None, actual)
示例#22
0
    def test_checkIllegalSoloTestJSFile(self):
        commit = PreCommit(None, None)
        file = open('./resources/illegal-js-files/IllegalJsSpec2.js', 'r')
        actual = commit.checkFile(file.read().splitlines())

        self.assertEqual(SOLO_TEST_MSG, actual)
示例#23
0
    def test_checkFile(self):
        commit = PreCommit(None, None)
        file = open('./resources/clean-java-files/Attribute.java', 'r')
        actual = commit.checkFile(file.read())

        self.assertEqual(None, actual)
示例#24
0
    def test_checkDartFile(self):
        commit = PreCommit(None, None)
        file = open('./resources/clean-dart-files/DartTest.dart', 'r')
        actual = commit.checkFile(file.read().splitlines())

        self.assertEqual(None, actual)
示例#25
0
    def test_checkDartFile(self):
        commit = PreCommit(None, None)
        file = open('./resources/clean-dart-files/DartTest.dart', 'r')
        actual = commit.checkFile(file.read().splitlines())

        self.assertEqual(None, actual)
示例#26
0
    def test_checkIllegalSoloTestDartFile(self):
        commit = PreCommit(None, None)
        file = open('./resources/illegal-dart-files/IllegalDartTest2.dart', 'r')
        actual = commit.checkFile(file.read().splitlines())

        self.assertEqual(SOLO_TEST_MSG, actual)