Exemplo n.º 1
0
    def test_defaults_centos(self):
        """Default python building block"""
        p = python()
        self.assertEqual(str(p),
r'''# Python
RUN yum install -y epel-release && \
    yum install -y \
        python \
        python34 && \
    rm -rf /var/cache/yum/*''')
Exemplo n.º 2
0
    def test_defaults_ubuntu(self):
        """Default python building block"""
        p = python()
        self.assertEqual(str(p),
r'''# Python
RUN apt-get update -y && \
    apt-get install -y --no-install-recommends \
        python \
        python3 && \
    rm -rf /var/lib/apt/lists/*''')
Exemplo n.º 3
0
    def test_runtime(self):
        """Runtime"""
        p = python()
        r = p.runtime()
        s = '\n'.join(str(x) for x in r)
        self.assertEqual(s,
r'''# Python
RUN apt-get update -y && \
    apt-get install -y --no-install-recommends \
        python \
        python3 && \
    rm -rf /var/lib/apt/lists/*''')