Exemple #1
0
    def test_singularity_only_singularity(self):
        """Only Singularity blob specified"""
        path = os.path.dirname(__file__)
        b = blob(singularity=os.path.join(path, 'singularity.blob'))
        self.assertEqual(str(b), '''%files
    foo bar

%post
    bar
''')
Exemple #2
0
    def test_all_singularity(self):
        """Both Docker and Singularity blobs specified"""
        path = os.path.dirname(__file__)
        b = blob(docker=os.path.join(path, 'docker.blob'),
                 singularity=os.path.join(path, 'singularity.blob'))
        self.assertEqual(str(b), '''%files
    foo bar

%post
    bar
''')
Exemple #3
0
 def test_all_docker(self):
     """Both Docker and Singularity blobs specified"""
     path = os.path.dirname(__file__)
     b = blob(docker=os.path.join(path, 'docker.blob'),
              singularity=os.path.join(path, 'singularity.blob'))
     self.assertEqual(str(b), 'COPY foo bar\nRUN bar\n')
Exemple #4
0
 def test_docker_only_singularity(self):
     """Only Docker blob specified"""
     path = os.path.dirname(__file__)
     b = blob(docker=os.path.join(path, 'docker.blob'))
     self.assertEqual(str(b), '')
Exemple #5
0
 def test_docker_only_docker(self):
     """Only Docker blob specified"""
     path = os.path.dirname(__file__)
     b = blob(docker=os.path.join(path, 'docker.blob'))
     self.assertEqual(str(b), 'COPY foo bar\nRUN bar\n')
Exemple #6
0
 def test_invalid_files(self):
     """Invalid file"""
     b = blob(docker='/path/to/nonexistent/file')
     self.assertEqual(str(b), '')
Exemple #7
0
 def test_invalid_ctype(self):
     """Invalid container type specified"""
     b = blob()
     with self.assertRaises(RuntimeError):
         str(b)
Exemple #8
0
 def test_empty(self):
     """No blob specified"""
     b = blob()
     self.assertEqual(str(b), '')