Esempio n. 1
0
 def test_parses_add(self, mock_delegate):
     parser.parse_dockerfile_with_delegate(self.add_dockerfile_stream,
                                           mock_delegate)
     assert mock_delegate.has_calls([
         mock.call.run_add('foo', 'bar'),
         mock.call.run_add('foo', '.'),
         mock.call.run_add('http://www.me.com?foo=bar', 'hello.txt')
     ])
Esempio n. 2
0
 def test_parses_env(self, mock_delegate):
     parser.parse_dockerfile_with_delegate(self.env_dockerfile_stream,
                                           mock_delegate)
     assert mock_delegate.has_calls([
         mock.call.run_env('FOO', 'BAR'),
         mock.call.run_env('HOME', '/root'),
         mock.call.run_env('TZ', ':America/New_York'),
         mock.call.run_env('LANG', 'EN.UTF-8'),
         mock.call.run_env('ME_BASE_HOME', '/usr/src/me-base')
     ])
Esempio n. 3
0
 def test_parses_run(self, mock_delegate):
     parser.parse_dockerfile_with_delegate(self.run_dockerfile_stream,
                                           mock_delegate)
     assert mock_delegate.has_calls([
         mock.call.run_run('apt-get update'),
         mock.call.run_run(
             'apt-get upgrade --assume-yes --verbose-versions '
             '--option Dpkg::Options::="--force-confold"  && apt-get install '
             '--assume-yes --verbose-versions        apt-utils        '
             'binfmt-support        build-essential        curl        '
             'dnsutils        git        htop        iftop        '
             'iotop        iputils-ping        libssl-dev        lsof        '
             'man        mlocate        netcat        pkg-config        '
             'rsync        strace        sudo        tcpdump        '
             'telnet        tzdata        vim        wget')
     ])
Esempio n. 4
0
 def test_parses_misc(self, mock_delegate):
     parser.parse_dockerfile_with_delegate(self.misc_dockerfile_stream,
                                           mock_delegate)
     assert mock_delegate.has_calls([
         mock.call.run_nop(),
         mock.call.run_nop(),
         mock.call.run_unknown('FROM phusion/passenger-full:1.0.6'),
         mock.call.run_unknown('LABEL maintainer "Me <*****@*****.**>"'),
         mock.call.run_nop(),
         mock.call.run_unknown('ARG DEBIAN_FRONTEND=noninteractive'),
         mock.call.run_nop(),
         mock.call.run_unknown('VOLUME $PIP_OVERRIDE_DIR'),
         mock.call.run_unknown('CMD ["/sbin/my_init"]'),
         mock.call.run_nop(),
         mock.call.run_nop(),
         mock.call.run_skip()
     ])
Esempio n. 5
0
 def test_can_parse(self):
     parser.parse_dockerfile_with_delegate(self.example_dockerfile_stream,
                                           self.target)
Esempio n. 6
0
 def test_parses_workdir(self, mock_delegate):
     parser.parse_dockerfile_with_delegate(self.workdir_dockerfile_stream,
                                           mock_delegate)
     assert mock_delegate.has_calls(
         [mock.call.run_workdir('/home/docker/app')],
         [mock.call.run_workdir('/home/docker/app')])
Esempio n. 7
0
 def test_parses_copy(self, mock_delegate):
     parser.parse_dockerfile_with_delegate(self.copy_dockerfile_stream,
                                           mock_delegate)
     assert mock_delegate.has_calls(
         [mock.call.run_copy('foo', 'bar'),
          mock.call.run_copy('foo', '.')])
Esempio n. 8
0
 def test_can_parse(self):
     parser.parse_dockerfile_with_delegate(self.example_dockerfile_stream,
                                           parser.AbstractParserDelegate())