예제 #1
0
 def test_read_missing_shebang(self):
     source = self.tmpdir / 'source'
     source.mkdir()
     (source / '__main__.py').touch()
     target = self.tmpdir / 'source.pyz'
     zipapp.create_archive(str(source), str(target))
     self.assertEqual(zipapp.get_interpreter(str(target)), None)
예제 #2
0
 def test_read_missing_shebang(self):
     # Test that reading the shebang line of a file without one returns None.
     source = self.tmpdir / 'source'
     source.mkdir()
     (source / '__main__.py').touch()
     target = self.tmpdir / 'source.pyz'
     zipapp.create_archive(str(source), str(target))
     self.assertEqual(zipapp.get_interpreter(str(target)), None)
예제 #3
0
 def test_read_shebang(self):
     # Test that we can read the shebang line correctly.
     source = self.tmpdir / 'source'
     source.mkdir()
     (source / '__main__.py').touch()
     target = self.tmpdir / 'source.pyz'
     zipapp.create_archive(str(source), str(target), interpreter='python')
     self.assertEqual(zipapp.get_interpreter(str(target)), 'python')
예제 #4
0
 def test_read_missing_shebang(self):
     # Test that reading the shebang line of a file without one returns None.
     source = self.tmpdir / 'source'
     source.mkdir()
     (source / '__main__.py').touch()
     target = self.tmpdir / 'source.pyz'
     zipapp.create_archive(str(source), str(target))
     self.assertEqual(zipapp.get_interpreter(str(target)), None)
예제 #5
0
 def test_read_shebang(self):
     # Test that we can read the shebang line correctly.
     source = self.tmpdir / 'source'
     source.mkdir()
     (source / '__main__.py').touch()
     target = self.tmpdir / 'source.pyz'
     zipapp.create_archive(str(source), str(target), interpreter='python')
     self.assertEqual(zipapp.get_interpreter(str(target)), 'python')
예제 #6
0
 def test_remove_shebang(self):
     source = self.tmpdir / 'source'
     source.mkdir()
     (source / '__main__.py').touch()
     target = self.tmpdir / 'source.pyz'
     zipapp.create_archive(str(source), str(target), interpreter='python')
     new_target = self.tmpdir / 'changed.pyz'
     zipapp.create_archive(str(target), str(new_target), interpreter=None)
     self.assertEqual(zipapp.get_interpreter(str(new_target)), None)
예제 #7
0
 def test_read_from_pathobj(self):
     source = self.tmpdir / 'source'
     source.mkdir()
     (source / '__main__.py').touch()
     target1 = self.tmpdir / 'target1.pyz'
     target2 = self.tmpdir / 'target2.pyz'
     zipapp.create_archive(source, target1, interpreter='python')
     zipapp.create_archive(target1, target2, interpreter='python2.7')
     self.assertEqual(zipapp.get_interpreter(target2), 'python2.7')
예제 #8
0
 def test_remove_shebang(self):
     # Test that we can remove the shebang from a file.
     source = self.tmpdir / 'source'
     source.mkdir()
     (source / '__main__.py').touch()
     target = self.tmpdir / 'source.pyz'
     zipapp.create_archive(str(source), str(target), interpreter='python')
     new_target = self.tmpdir / 'changed.pyz'
     zipapp.create_archive(str(target), str(new_target), interpreter=None)
     self.assertEqual(zipapp.get_interpreter(str(new_target)), None)
예제 #9
0
 def test_modify_shebang(self):
     # Test that we can change the shebang of a file.
     source = self.tmpdir / 'source'
     source.mkdir()
     (source / '__main__.py').touch()
     target = self.tmpdir / 'source.pyz'
     zipapp.create_archive(str(source), str(target), interpreter='python')
     new_target = self.tmpdir / 'changed.pyz'
     zipapp.create_archive(str(target), str(new_target), interpreter='python2.7')
     self.assertEqual(zipapp.get_interpreter(str(new_target)), 'python2.7')
예제 #10
0
 def test_read_from_pathobj(self):
     # Test that we can copy an archive using an pathlib.Path object
     # for the source.
     source = self.tmpdir / 'source'
     source.mkdir()
     (source / '__main__.py').touch()
     target1 = self.tmpdir / 'target1.pyz'
     target2 = self.tmpdir / 'target2.pyz'
     zipapp.create_archive(source, target1, interpreter='python')
     zipapp.create_archive(target1, target2, interpreter='python2.7')
     self.assertEqual(zipapp.get_interpreter(target2), 'python2.7')
예제 #11
0
 def test_read_from_pathobj(self):
     # Test that we can copy an archive using a pathlib.Path object
     # for the source.
     source = self.tmpdir / 'source'
     source.mkdir()
     (source / '__main__.py').touch()
     target1 = self.tmpdir / 'target1.pyz'
     target2 = self.tmpdir / 'target2.pyz'
     zipapp.create_archive(source, target1, interpreter='python')
     zipapp.create_archive(target1, target2, interpreter='python2.7')
     self.assertEqual(zipapp.get_interpreter(target2), 'python2.7')
예제 #12
0
파일: nodes.py 프로젝트: xxoolm/Ryven
 def update_event(self, inp=-1):
     self.set_output_val(0, zipapp.get_interpreter(self.input(0)))