Example #1
0
 def test_load_baseimage(self, mock_labbook):
     """Ensure the FROM line exists in the _load_baseimage function. """
     lb = mock_labbook[2]
     populate_with_pkgs(lb)
     ib = ImageBuilder(lb)
     docker_lines = ib._load_baseimage()
     assert any(["FROM gigdev/gm-quickstart" in l for l in docker_lines])
Example #2
0
 def test_load_baseimage_only_from(self, mock_labbook):
     """Ensure that _load_baseimage ONLY sets the FROM line, all others are comments or empty"""
     lb = mock_labbook[2]
     populate_with_pkgs(lb)
     ib = ImageBuilder(lb)
     assert len([
         l for l in ib._load_baseimage() if len(l) > 0 and l[0] != '#'
     ]) == 1