-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
43 lines (40 loc) · 1.16 KB
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import os
import subprocess
import unittest
import unittest.mock
class Test3(unittest.TestCase):
def test_simple(self):
env = {k: v for k, v in os.environ.items() if not k.endswith("_COLORS")}
env["PYTHONUTF8"] = "1"
process = subprocess.run(
os.path.abspath("3"),
shell=True,
env=env,
stdout=subprocess.PIPE,
)
self.assertEqual(process.returncode, 0)
self.assertEqual(
process.stdout,
"""
[01;34m.[0m
├── [01;34m.github[0m
│ └── [01;34mworkflows[0m
│ ├── [00mblack.yml[0m
│ ├── [00mmacos.yml[0m
│ ├── [00msetup.yml[0m
│ ├── [00mubuntu.yml[0m
│ └── [00mwindows.yml[0m
├── [00m.gitignore[0m
├── [01;32m3[0m
├── [01;32m3.cmd[0m
├── [01;34mexamples[0m
│ └── [00m3.png[0m
├── [00mLICENSE.md[0m
├── [00mpyproject.toml[0m
├── [00mREADME.md[0m
├── [00mrequirements.txt[0m
├── [00msetup.py[0m
└── [00mtests.py[0m
3 directories, 15 files
""".lstrip().encode(),
)