Ejemplo n.º 1
0
 def test_extract_none(self) -> None:
     self.assertEqual(
         extract_scripts.extract({
             'name': 'Checkout PyTorch',
             'uses': 'actions/checkout@v2',
         }),
         None,
     )
Ejemplo n.º 2
0
 def test_extract_none(self) -> None:
     self.assertEqual(
         extract_scripts.extract({
             'name':
             'Checkout PyTorch',
             'uses':
             'zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9',
         }),
         None,
     )
Ejemplo n.º 3
0
 def test_extract_none(self) -> None:
     self.assertEqual(
         extract_scripts.extract(
             {
                 "name": "Checkout PyTorch",
                 "uses": "zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9",
             }
         ),
         None,
     )
Ejemplo n.º 4
0
 def test_extract_run_default_bash(self) -> None:
     self.assertEqual(
         extract_scripts.extract({
             'name': 'Install requirements',
             'run': 'pip install -r requirements.txt',
         }),
         {
             'extension': '.sh',
             'script': requirements_sh,
         },
     )
Ejemplo n.º 5
0
 def test_extract_run_py(self) -> None:
     self.assertEqual(
         extract_scripts.extract({
             'name': 'Hello world',
             'run': 'print("Hello!")',
             'shell': 'python',
         }),
         {
             'extension': '.py',
             'script': 'print("Hello!")',
         },
     )
Ejemplo n.º 6
0
 def test_extract_run_sh(self) -> None:
     self.assertEqual(
         extract_scripts.extract({
             'name': 'Hello world',
             'run': 'echo hello world',
             'shell': 'sh',
         }),
         {
             'extension': '.sh',
             'script': hello_sh,
         },
     )
Ejemplo n.º 7
0
 def test_extract_run_default_bash(self) -> None:
     self.assertEqual(
         extract_scripts.extract(
             {
                 "name": "Install requirements",
                 "run": "pip install -r requirements.txt",
             }
         ),
         {
             "extension": ".sh",
             "script": requirements_sh,
         },
     )
Ejemplo n.º 8
0
 def test_extract_run_py(self) -> None:
     self.assertEqual(
         extract_scripts.extract(
             {
                 "name": "Hello world",
                 "run": 'print("Hello!")',
                 "shell": "python",
             }
         ),
         {
             "extension": ".py",
             "script": 'print("Hello!")',
         },
     )
Ejemplo n.º 9
0
 def test_extract_run_sh(self) -> None:
     self.assertEqual(
         extract_scripts.extract(
             {
                 "name": "Hello world",
                 "run": "echo hello world",
                 "shell": "sh",
             }
         ),
         {
             "extension": ".sh",
             "script": hello_sh,
         },
     )
Ejemplo n.º 10
0
 def test_extract_github_script(self) -> None:
     self.assertEqual(
         # https://github.com/actions/github-script/tree/v3.1.1#reading-step-results
         extract_scripts.extract({
             'uses': 'actions/github-script@v3',
             'id': 'set-result',
             'with': {
                 'script': 'return "Hello!"',
                 'result-encoding': 'string',
             },
         }),
         {
             'extension': '.js',
             'script': 'return "Hello!"',
         },
     )
Ejemplo n.º 11
0
 def test_extract_github_script(self) -> None:
     self.assertEqual(
         # https://github.com/actions/github-script/tree/v3.1.1#reading-step-results
         extract_scripts.extract(
             {
                 "uses": "actions/github-script@v3",
                 "id": "set-result",
                 "with": {
                     "script": 'return "Hello!"',
                     "result-encoding": "string",
                 },
             }
         ),
         {
             "extension": ".js",
             "script": 'return "Hello!"',
         },
     )