summaryrefslogtreecommitdiff
blob: db43e366b389b8357c1fe68ecf6b3946f686e17d (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
--- a/tests/test_options/test_replay.py
+++ b/tests/test_options/test_replay.py
@@ -69,7 +69,7 @@ def test_replay_match_basename():
     create_file('xxx', 'test1/b')
     create_file('xxx', 'test2/a')
 
-    replay_path = '/tmp/replay.json'
+    replay_path = os.path.join(TESTDIR_NAME, 'replay.json')
 
     head, *data, footer = run_rmlint('-o json:{p}'.format(
         p=replay_path
@@ -104,7 +104,7 @@ def test_replay_hidden():
     create_file('xxx', 'test/.a')
     create_file('xxx', 'test/.b')
 
-    replay_path = '/tmp/replay.json'
+    replay_path = os.path.join(TESTDIR_NAME, 'replay.json')
 
     head, *data, footer = run_rmlint('--hidden -o json:{p}'.format(
         p=replay_path
@@ -130,7 +130,7 @@ def test_replay_must_match_tagged():
     create_file('xxx', 'test_a/a')
     create_file('xxx', 'test_b/a')
 
-    replay_path = '/tmp/replay.json'
+    replay_path = os.path.join(TESTDIR_NAME, 'replay.json')
 
     head, *data, footer = run_rmlint('-o json:{p}'.format(
         p=replay_path
@@ -182,7 +182,7 @@ def test_sorting():
             (''.join(p) for p in permutations(all_opts, n_terms))
         )
 
-    replay_path = '/tmp/replay.json'
+    replay_path = os.path.join(TESTDIR_NAME, 'replay.json')
 
     for combo in combos:
         combo_str = '-y ' + combo
@@ -218,7 +218,7 @@ def test_replay_no_dir():
 
     try:
         os.chdir(TESTDIR_NAME)
-        replay_path = '/tmp/replay.json'
+        replay_path = os.path.join(TESTDIR_NAME, 'replay.json')
         head, *data, footer = run_rmlint(
                 '-o json:{p}'.format(p=replay_path),
                 use_default_dir=False,
@@ -242,7 +242,7 @@ def test_replay_unicode_fuckup():
     create_file('xxx', names[1])
     create_file('xxx', names[2])
 
-    replay_path = '/tmp/replay.json'
+    replay_path = os.path.join(TESTDIR_NAME, 'replay.json')
 
     head, *data, footer = run_rmlint('-o json:{p}'.format(p=replay_path))
     assert len(data) == 3
@@ -260,8 +260,8 @@ def test_replay_tagged_order():
     create_file('xxx', 'b/1')
     create_file('xxx', 'b/2')
 
-    replay_path_a = '/tmp/replay-a.json'
-    replay_path_b = '/tmp/replay-b.json'
+    replay_path_a = os.path.join(TESTDIR_NAME, 'replay-a.json')
+    replay_path_b = os.path.join(TESTDIR_NAME, 'replay-b.json')
 
     # Create replay-a.json
     head, *data, footer = run_rmlint(
@@ -326,7 +326,7 @@ def test_replay_duplicate_directory_size():
     create_file('xxx', 'a/xxx')
     create_file('xxx', 'b/xxx')
 
-    replay_path = '/tmp/replay.json'
+    replay_path = os.path.join(TESTDIR_NAME, 'replay.json')
     head, *data, footer = run_rmlint('-o json:{p} -S a'.format(p=replay_path))
     assert len(data) == 2
 
@@ -427,7 +427,7 @@ def test_replay_pack_directories():
     create_pack_and_unpack_scenario()
 
     # Do a run without -D and pack it later during --replay.
-    replay_path = '/tmp/replay.json'
+    replay_path = os.path.join(TESTDIR_NAME, 'replay.json')
 
     head, *data, footer = run_rmlint('-o json:{p} -S ahD'.format(p=replay_path))
     assert len(data) == 13
@@ -449,7 +449,7 @@ def test_replay_unpack_directories():
     create_pack_and_unpack_scenario()
 
     # Do a run with -D and pack it later during --replay.
-    replay_path = '/tmp/replay.json'
+    replay_path = os.path.join(TESTDIR_NAME, 'replay.json')
     head, *data, footer = run_rmlint('-o json:{p} -S ahD -D'.format(p=replay_path))
 
     assert len(data) == 21
--- a/tests/test_options/test_size.py
+++ b/tests/test_options/test_size.py
@@ -90,7 +90,7 @@ def test_replay_size():
     create_file('yyy', 'b/yyy')
     create_testdir('empty_dir')
 
-    replay_path = '/tmp/replay.json'
+    replay_path = os.path.join(TESTDIR_NAME, 'replay.json')
     head, *data, footer = run_rmlint('-o json:{p}'.format(
         p=replay_path
     ))
--- a/tests/test_options/test_stdin.py
+++ b/tests/test_options/test_stdin.py
@@ -69,7 +69,6 @@ def test_path_starting_with_dash():
         os.chdir(TESTDIR_NAME)
         data = check_output(
             [cwd + '/rmlint', '-o', 'json', '-S', 'a', '--', subdir],
-            stderr=STDOUT
         )
     finally:
         os.chdir(cwd)
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -133,7 +133,7 @@ def run_rmlint_once(*args,
 
     cmd += shlex.split(' '.join(args))
     if with_json:
-        cmd += ['-o', 'json:/tmp/out.json', '-c', 'json:oneline']
+        cmd += ['-o', 'json:' + os.path.join(TESTDIR_NAME, 'out.json'), '-c', 'json:oneline']
 
     for idx, output in enumerate(outputs or []):
         cmd.append('-o')
@@ -168,7 +168,7 @@ def run_rmlint_once(*args,
         return output
 
     if with_json:
-        with open('/tmp/out.json', 'r') as f:
+        with open(os.path.join(TESTDIR_NAME, 'out.json'), 'r') as f:
             json_data = json.loads(f.read())
     else:
         json_data = []