def test_runtime(self): """Runtime""" f = fftw() r = f.runtime() s = '\n'.join(str(x) for x in r) self.assertEqual( s, r'''# FFTW COPY --from=0 /usr/local/fftw /usr/local/fftw ENV LD_LIBRARY_PATH=/usr/local/fftw/lib:$LD_LIBRARY_PATH''')
def test_directory(self): """Directory in local build context""" f = fftw(directory='fftw-3.3.7') self.assertEqual( str(f), r'''# FFTW RUN apt-get update -y && \ apt-get install -y --no-install-recommends \ file \ make \ wget && \ rm -rf /var/lib/apt/lists/* COPY fftw-3.3.7 /tmp/fftw-3.3.7 RUN cd /tmp/fftw-3.3.7 && ./configure --prefix=/usr/local/fftw --enable-shared --enable-openmp --enable-threads --enable-sse2 && \ make -j4 && \ make -j4 install && \ rm -rf /tmp/fftw-3.3.7 ENV LD_LIBRARY_PATH=/usr/local/fftw/lib:$LD_LIBRARY_PATH''')
def test_defaults_centos(self): """Default fftw building block""" f = fftw() self.assertEqual( str(f), r'''# FFTW version 3.3.7 RUN yum install -y \ file \ make \ wget && \ rm -rf /var/cache/yum/* RUN mkdir -p /tmp && wget -q --no-check-certificate -P /tmp ftp://ftp.fftw.org/pub/fftw/fftw-3.3.7.tar.gz && \ tar -x -f /tmp/fftw-3.3.7.tar.gz -C /tmp -z && \ cd /tmp/fftw-3.3.7 && ./configure --prefix=/usr/local/fftw --enable-shared --enable-openmp --enable-threads --enable-sse2 && \ make -j4 && \ make -j4 install && \ rm -rf /tmp/fftw-3.3.7.tar.gz /tmp/fftw-3.3.7 ENV LD_LIBRARY_PATH=/usr/local/fftw/lib:$LD_LIBRARY_PATH''')
def test_defaults_ubuntu(self): """Default fftw building block""" f = fftw() self.assertEqual(str(f), r'''# FFTW version 3.3.7 RUN apt-get update -y && \ apt-get install -y --no-install-recommends \ file \ make \ wget && \ rm -rf /var/lib/apt/lists/* RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp ftp://ftp.fftw.org/pub/fftw/fftw-3.3.7.tar.gz && \ mkdir -p /var/tmp && tar -x -f /var/tmp/fftw-3.3.7.tar.gz -C /var/tmp -z && \ cd /var/tmp/fftw-3.3.7 && ./configure --prefix=/usr/local/fftw --enable-shared --enable-openmp --enable-threads --enable-sse2 && \ make -j4 && \ make -j4 install && \ rm -rf /var/tmp/fftw-3.3.7.tar.gz /var/tmp/fftw-3.3.7 ENV LD_LIBRARY_PATH=/usr/local/fftw/lib:$LD_LIBRARY_PATH''')