Esempio n. 1
0
 def test_docker_only(self):
     """Only Docker blob specified"""
     path = os.path.dirname(__file__)
     b = blob(docker=os.path.join(path, 'docker.blob'))
     self.assertEqual(b.toString(container_type.DOCKER),
                      'COPY foo bar\nRUN bar\n')
     self.assertEqual(b.toString(container_type.SINGULARITY), '')
Esempio n. 2
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
''')
Esempio n. 3
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
''')
Esempio n. 4
0
    def test_singularity_only(self):
        """Only Singularity blob specified"""
        path = os.path.dirname(__file__)
        b = blob(singularity=os.path.join(path, 'singularity.blob'))
        self.assertEqual(b.toString(container_type.DOCKER), '')
        self.assertEqual(b.toString(container_type.SINGULARITY), '''%files
    foo bar

%post
    bar
''')
Esempio n. 5
0
    def test_all(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(b.toString(container_type.DOCKER),
                         'COPY foo bar\nRUN bar\n')
        self.assertEqual(b.toString(container_type.SINGULARITY), '''%files
    foo bar

%post
    bar
''')
Esempio n. 6
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')
Esempio n. 7
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), '')
Esempio n. 8
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')
Esempio n. 9
0
 def test_invalid_files(self):
     """Invalid file"""
     b = blob(docker='/path/to/nonexistent/file')
     self.assertEqual(str(b), '')
Esempio n. 10
0
 def test_invalid_ctype(self):
     """Invalid container type specified"""
     b = blob()
     with self.assertRaises(RuntimeError):
         str(b)
Esempio n. 11
0
 def test_empty(self):
     """No blob specified"""
     b = blob()
     self.assertEqual(str(b), '')
Esempio n. 12
0
 def test_invalid_files(self):
     """Invalid file"""
     b = blob(docker='/path/to/nonexistent/file')
     self.assertEqual(b.toString(container_type.DOCKER), '')
Esempio n. 13
0
 def test_invalid_ctype(self):
     """Invalid container type specified"""
     b = blob()
     self.assertEqual(b.toString(None), '')
Esempio n. 14
0
 def test_empty(self):
     """No blob specified"""
     b = blob()
     self.assertEqual(b.toString(container_type.DOCKER), '')