[Notes] [Git][BuildStream/buildstream][master] 2 commits: tests/frontend/buildcheckout.py: Fix bad filename issue for Windows



Title: GitLab

Chandan Singh pushed to branch master at BuildStream / buildstream

Commits:

3 changed files:

Changes:

  • tests/frontend/buildcheckout.py
    ... ... @@ -3,6 +3,7 @@ import tarfile
    3 3
     import hashlib
    
    4 4
     import pytest
    
    5 5
     from tests.testutils import cli, create_repo, ALL_REPO_KINDS, generate_junction
    
    6
    +from tests.testutils.site import IS_WINDOWS
    
    6 7
     
    
    7 8
     from buildstream import _yaml
    
    8 9
     from buildstream._exceptions import ErrorDomain, LoadErrorReason
    
    ... ... @@ -85,16 +86,37 @@ def test_build_invalid_suffix_dep(datafiles, cli, strict, hardlinks):
    85 86
         result.assert_main_error(ErrorDomain.LOAD, "bad-element-suffix")
    
    86 87
     
    
    87 88
     
    
    89
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    88 90
     @pytest.mark.datafiles(DATA_DIR)
    
    89 91
     def test_build_invalid_filename_chars(datafiles, cli):
    
    90 92
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    91
    -    result = cli.run(project=project, args=strict_args(['build', 'invalid-chars|<>-in-name.bst'], 'non-strict'))
    
    93
    +    element_name = 'invalid-chars|<>-in-name.bst'
    
    94
    +
    
    95
    +    # The name of this file contains characters that are not allowed by
    
    96
    +    # BuildStream, using it should raise a warning.
    
    97
    +    element = {
    
    98
    +        'kind': 'stack',
    
    99
    +    }
    
    100
    +    _yaml.dump(element, os.path.join(project, 'elements', element_name))
    
    101
    +
    
    102
    +    result = cli.run(project=project, args=strict_args(['build', element_name], 'non-strict'))
    
    92 103
         result.assert_main_error(ErrorDomain.LOAD, "bad-characters-in-name")
    
    93 104
     
    
    94 105
     
    
    106
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    95 107
     @pytest.mark.datafiles(DATA_DIR)
    
    96 108
     def test_build_invalid_filename_chars_dep(datafiles, cli):
    
    97 109
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    110
    +    element_name = 'invalid-chars|<>-in-name.bst'
    
    111
    +
    
    112
    +    # The name of this file contains characters that are not allowed by
    
    113
    +    # BuildStream, and is listed as a dependency of 'invalid-chars-in-dep.bst'.
    
    114
    +    # This should also raise a warning.
    
    115
    +    element = {
    
    116
    +        'kind': 'stack',
    
    117
    +    }
    
    118
    +    _yaml.dump(element, os.path.join(project, 'elements', element_name))
    
    119
    +
    
    98 120
         result = cli.run(project=project, args=strict_args(['build', 'invalid-chars-in-dep.bst'], 'non-strict'))
    
    99 121
         result.assert_main_error(ErrorDomain.LOAD, "bad-characters-in-name")
    
    100 122
     
    

  • tests/frontend/project/elements/invalid-chars|<>-in-name.bst deleted
    1
    -kind: stack
    
    2
    -description: |
    
    3
    -  The name of this files contains characters that are not allowed by
    
    4
    -  BuildStream, using it should raise a warning.

  • tests/testutils/site.py
    ... ... @@ -52,5 +52,6 @@ except ImportError:
    52 52
         HAVE_ARPY = False
    
    53 53
     
    
    54 54
     IS_LINUX = os.getenv('BST_FORCE_BACKEND', sys.platform).startswith('linux')
    
    55
    +IS_WINDOWS = (os.name == 'nt')
    
    55 56
     
    
    56 57
     MACHINE_ARCH = Platform.get_host_arch()



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]