yhttp-dev 3.3.1__tar.gz → 3.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yhttp-dev
3
- Version: 3.3.1
3
+ Version: 3.4.1
4
4
  Summary: yhttp development utilities
5
5
  Home-page: https://github.com/yhttp/yhttp-dev
6
6
  Author: pylover
@@ -0,0 +1 @@
1
+ __version__ = '3.4.1'
@@ -1,4 +1,5 @@
1
1
  import os
2
+ import stat
2
3
  import shutil
3
4
  import socket
4
5
  import tempfile
@@ -14,6 +15,41 @@ CICD = 'CI' in os.environ \
14
15
  and 'GITHUB_RUN_ID' in os.environ
15
16
 
16
17
 
18
+ @pytest.fixture
19
+ def bddcli_bootstrapper_patch(tempdir):
20
+ @contextlib.contextmanager
21
+ def patch(pycode):
22
+ tmp = tempfile.mkdtemp()
23
+
24
+ venvdir = os.environ.get('VIRTUAL_ENV')
25
+ if venvdir is None:
26
+ raise ValueError('Tests must be run inside a virtual env')
27
+
28
+ bsfile = os.path.join(venvdir, 'bin', 'bddcli-bootstrapper')
29
+ assert os.path.exists(bsfile)
30
+ newname = os.path.join(tempdir, 'backup')
31
+ os.rename(bsfile, os.path.join(tempdir, 'backup'))
32
+
33
+ with open(newname) as infile, open(bsfile, 'w') as outfile:
34
+ outfile.write(infile.readline())
35
+ outfile.write(infile.readline())
36
+ outfile.write(pycode)
37
+ outfile.write(infile.read())
38
+
39
+ # set the execution bit
40
+ mode = os.fstat(outfile.fileno()).st_mode
41
+ mode |= stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
42
+ os.fchmod(outfile.fileno(), stat.S_IMODE(mode))
43
+
44
+ try:
45
+ yield
46
+ finally:
47
+ os.rename(newname, bsfile)
48
+ shutil.rmtree(tmp)
49
+
50
+ return patch
51
+
52
+
17
53
  @pytest.fixture
18
54
  def cicd():
19
55
  return CICD
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yhttp-dev
3
- Version: 3.3.1
3
+ Version: 3.4.1
4
4
  Summary: yhttp development utilities
5
5
  Home-page: https://github.com/yhttp/yhttp-dev
6
6
  Author: pylover
@@ -1 +0,0 @@
1
- __version__ = '3.3.1'
File without changes
File without changes
File without changes
File without changes