Exemple #1
0
    def test_check_if_dir_exists_returns_false_path_is_none(
            self, mock_exists, mock_isdir):
        """ Test a valid invocation of API check_if_directory_exists """

        # arrange
        dir_path = None

        # act
        result = EdgeUtils.check_if_directory_exists(dir_path)

        # assert
        mock_exists.assert_not_called()
        mock_isdir.assert_not_called()
        self.assertFalse(result)
Exemple #2
0
    def test_check_if_dir_exists_returns_true(self, mock_exists, mock_isdir):
        """ Test a valid invocation of API check_if_directory_exists """
        # arrange #1
        dir_path = 'blah'
        mock_exists.return_value = True
        mock_isdir.return_value = True

        # act
        result = EdgeUtils.check_if_directory_exists(dir_path)

        # assert
        mock_exists.assert_called_with(dir_path)
        mock_isdir.assert_called_with(dir_path)
        self.assertTrue(result)