Esempio n. 1
0
 def test_find_tests_config_none(self):
     """
     Test that if no configuration file is present, None is returned
     :return:
     """
     assert BehaveWorkingDirectory.find_tests_config(
         self.WORKING_DIR) is None
Esempio n. 2
0
    def test_find_tests_config_multiple(self):
        """
        Test that configuration files are found and that .ini has preference
        :return:
        """
        files = [
            'test.ini',
            'tests.conf',
        ]

        for f in files:
            with open(f, 'w') as fw:
                fw.write('xyz')

        assert BehaveWorkingDirectory.find_tests_config(self.WORKING_DIR) == os.path.join(self.WORKING_DIR, files[0])
Esempio n. 3
0
    def test_find_tests_config_multiple(self):
        """
        Test that configuration files are found and that .ini has preference
        :return:
        """
        files = [
            'test.ini',
            'tests.conf',
        ]

        for f in files:
            with open(f, 'w') as fw:
                fw.write('xyz')

        assert BehaveWorkingDirectory.find_tests_config(
            self.WORKING_DIR) == os.path.join(self.WORKING_DIR, files[0])
Esempio n. 4
0
    def test_find_tests_config_existing(self):
        """
        Test that configuration files are successfully found
        :return:
        """

        files = [
            'test.ini',
            'tests.ini',
            'test.conf',
            'tests.conf',
        ]

        for f in files:
            with open(f, 'w') as fw:
                fw.write('xyz')
            assert BehaveWorkingDirectory.find_tests_config(self.WORKING_DIR) == os.path.join(self.WORKING_DIR, f)
            os.remove(f)
            assert not os.path.exists(f)
Esempio n. 5
0
    def test_find_tests_config_existing(self):
        """
        Test that configuration files are successfully found
        :return:
        """

        files = [
            'test.ini',
            'tests.ini',
            'test.conf',
            'tests.conf',
        ]

        for f in files:
            with open(f, 'w') as fw:
                fw.write('xyz')
            assert BehaveWorkingDirectory.find_tests_config(
                self.WORKING_DIR) == os.path.join(self.WORKING_DIR, f)
            os.remove(f)
            assert not os.path.exists(f)
Esempio n. 6
0
 def test_find_tests_config_none(self):
     """
     Test that if no configuration file is present, None is returned
     :return:
     """
     assert BehaveWorkingDirectory.find_tests_config(self.WORKING_DIR) is None