def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") # with the right language weaver.language = "html" # render text = list(weaver.weave()) # check assert text == [ '<!doctype html>', '<!--', ' ! ', ' ! Michael A.G. Aïvázis', ' ! Orthologue', ' ! (c) 1998-2019 All Rights Reserved', ' ! ', ' -->', '<html>', '', '', '</html>', '<!-- end of file -->' ] # all done return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "svg" text = list(weaver.weave()) assert text == [ '<?xml version="1.0"?>', '<!--', ' ! ', ' ! Michael A.G. Aïvázis', ' ! Orthologue', ' ! (c) 1998-2019 All Rights Reserved', ' ! ', ' -->', '', '<svg version="1.1" xmlns="http://www.w3.org/2000/svg">', '', '', '</svg>', '', '<!-- end of file -->' ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") # with the right language weaver.language = "html" # render text = list(weaver.weave()) # check assert text == [ '<!doctype html>', '<!--', ' ! ', ' ! Michael A.G. Aïvázis', ' ! Orthologue', ' ! (c) 1998-2020 All Rights Reserved', ' ! ', ' -->', '<html>', '', '', '</html>', '<!-- end of file -->' ] # all done return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "pfg" text = list(weaver.weave()) assert text == [ ';', '; Michael A.G. Aïvázis', '; Orthologue', '; (c) 1998-2020 All Rights Reserved', ';', '', '', '; end of file' ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "xml" text = list(weaver.weave()) assert text == [ '<?xml version="1.0"?>', '<!--', ' ! ', ' ! Michael A.G. Aïvázis', ' ! Orthologue', ' ! (c) 1998-2022 All Rights Reserved', ' ! ', ' -->', '', '', '<!-- end of file -->' ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "C" text = list(weaver.weave()) # print("\n".join(text)) assert text == [ '/*', ' * -*- C -*-', ' * ', ' * Michael A.G. Aïvázis', ' * Orthologue', ' * (c) 1998-2020 All Rights Reserved', ' * ', ' */', '', '', '/* end of file */' ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "sh" text = list(weaver.weave()) assert text == [ '#!/bin/bash', '#', '# Michael A.G. Aïvázis', '# Orthologue', '# (c) 1998-2019 All Rights Reserved', '#', '', '', '# end of file', ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "sql" text = list(weaver.weave()) assert text == [ '-- -*- SQL -*-', '--', '-- Michael A.G. Aïvázis', '-- Orthologue', '-- (c) 1998-2019 All Rights Reserved', '--', '', '', '-- end of file', ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "f77" text = list(weaver.weave()) assert text == [ 'c -*- Fortran -*-', 'c', 'c Michael A.G. Aïvázis', 'c Orthologue', 'c (c) 1998-2020 All Rights Reserved', 'c', '', '', 'c end of file', ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "f90" text = list(weaver.weave()) assert text == [ '! -*- F90 -*-', '!', '! Michael A.G. Aïvázis', '! Orthologue', '! (c) 1998-2019 All Rights Reserved', '!', '', '', '! end of file', ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "C++" text = list(weaver.weave()) assert text == [ '// -*- C++ -*-', '//', '// Michael A.G. Aïvázis', '// Orthologue', '// (c) 1998-2019 All Rights Reserved', '//', '', '', '// end of file', ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "sh" text = list(weaver.weave()) assert text == [ '#!/bin/bash', '#', '# Michael A.G. Aïvázis', '# Orthologue', '# (c) 1998-2018 All Rights Reserved', '#', '', '', '# end of file', ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "C++" text = list(weaver.weave()) assert text == [ '// -*- C++ -*-', '//', '// Michael A.G. Aïvázis', '// Orthologue', '// (c) 1998-2022 All Rights Reserved', '//', '', '', '// end of file', ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "f90" text = list(weaver.weave()) assert text == [ '! -*- F90 -*-', '!', '! Michael A.G. Aïvázis', '! Orthologue', '! (c) 1998-2022 All Rights Reserved', '!', '', '', '! end of file', ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "TeX" weaver.language.languageMarker = "TeX" text = list(weaver.weave()) assert text == [ '% -*- TeX -*-', '%', '% Michael A.G. Aïvázis', '% Orthologue', '% (c) 1998-2020 All Rights Reserved', '%', '', '', '% end of file', ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "TeX" weaver.language.languageMarker = "TeX" text = list(weaver.weave()) assert text == [ '% -*- TeX -*-', '%', '% Michael A.G. Aïvázis', '% Orthologue', '% (c) 1998-2019 All Rights Reserved', '%', '', '', '% end of file', ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "python" weaver.language.script = True weaver.language.version = "3.2" weaver.language.languageMarker = "" text = list(weaver.weave()) assert text == [ '#!/usr/bin/env python3.2', '#', '# Michael A.G. Aïvázis', '# Orthologue', '# (c) 1998-2022 All Rights Reserved', '#', '', '', '# end of file', ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "C" text = list(weaver.weave()) # print("\n".join(text)) assert text == [ '/*', ' * -*- C -*-', ' * ', ' * Michael A.G. Aïvázis', ' * Orthologue', ' * (c) 1998-2019 All Rights Reserved', ' * ', ' */', '', '', '/* end of file */' ] return
def test(): # get the package import pyre.weaver # instantiate a weaver weaver = pyre.weaver.weaver(name="sanity") weaver.language = "python" weaver.language.script = True weaver.language.version = "3.2" weaver.language.languageMarker = "" text = list(weaver.weave()) assert text == [ '#!/usr/bin/env python3.2', '#', '# Michael A.G. Aïvázis', '# Orthologue', '# (c) 1998-2019 All Rights Reserved', '#', '', '', '# end of file', ] return