yhttp-dev 3.2.4__tar.gz → 3.4.0__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,12 +1,19 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: yhttp-dev
3
- Version: 3.2.4
3
+ Version: 3.4.0
4
4
  Summary: yhttp development utilities
5
5
  Home-page: https://github.com/yhttp/yhttp-dev
6
6
  Author: pylover
7
7
  Author-email: vahid.mardani@gmail.com
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
+ Dynamic: author
11
+ Dynamic: author-email
12
+ Dynamic: description
13
+ Dynamic: description-content-type
14
+ Dynamic: home-page
15
+ Dynamic: license-file
16
+ Dynamic: summary
10
17
 
11
18
  # yhttp-dev
12
19
 
@@ -0,0 +1 @@
1
+ __version__ = '3.4.0'
@@ -1,4 +1,5 @@
1
1
  import os
2
+ import stat
2
3
  import shutil
3
4
  import socket
4
5
  import tempfile
@@ -14,11 +15,52 @@ 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
+ yield
45
+
46
+ os.rename(newname, bsfile)
47
+ shutil.rmtree(tmp)
48
+
49
+ return patch
50
+
51
+
17
52
  @pytest.fixture
18
53
  def cicd():
19
54
  return CICD
20
55
 
21
56
 
57
+ @pytest.fixture
58
+ def tempdir():
59
+ tdir = tempfile.mkdtemp()
60
+ yield tdir
61
+ shutil.rmtree(tdir)
62
+
63
+
22
64
  @pytest.fixture
23
65
  def mockupfs():
24
66
  temp_directories = []
@@ -1,12 +1,19 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: yhttp-dev
3
- Version: 3.2.4
3
+ Version: 3.4.0
4
4
  Summary: yhttp development utilities
5
5
  Home-page: https://github.com/yhttp/yhttp-dev
6
6
  Author: pylover
7
7
  Author-email: vahid.mardani@gmail.com
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
+ Dynamic: author
11
+ Dynamic: author-email
12
+ Dynamic: description
13
+ Dynamic: description-content-type
14
+ Dynamic: home-page
15
+ Dynamic: license-file
16
+ Dynamic: summary
10
17
 
11
18
  # yhttp-dev
12
19
 
@@ -1 +0,0 @@
1
- __version__ = '3.2.4'
File without changes
File without changes
File without changes
File without changes