-
Notifications
You must be signed in to change notification settings - Fork 302
/
list_single_profile.t
executable file
·50 lines (38 loc) · 1.61 KB
/
list_single_profile.t
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import unittest
from simpletap.fdecrypt import lib
class TestSingleProfile(unittest.TestCase):
def listing_from_single_profile(self):
test = os.path.join(lib.get_test_data(), self.test_profile)
cmd = lib.get_script() + ["-l", test]
expected = lib.get_output_data(self.output_data)
expected_exitcode = 2
output = lib.remove_full_pwd(
lib.remove_log_date_time(
lib.run_error(cmd, returncode=expected_exitcode)))
if lib.platform == "Windows":
# Paths in Windows cause failures with string comparison
output = output.replace("\\", "/")
self.assertEqual(output, expected)
@unittest.skipIf(lib.platform == "Windows",
"Windows DLL isn't backwards compatible")
def test_firefox_20(self):
self.test_profile = "test_profile_firefox_20"
self.output_data = "list_single_20"
self.listing_from_single_profile()
@unittest.skipIf(lib.platform == "Windows",
"Windows DLL isn't backwards compatible")
def test_firefox_46(self):
self.test_profile = "test_profile_firefox_46"
self.output_data = "list_single_46"
self.listing_from_single_profile()
def test_firefox_59(self):
self.test_profile = "test_profile_firefox_59"
self.output_data = "list_single_59"
self.listing_from_single_profile()
if __name__ == "__main__":
from simpletap import TAPTestRunner
unittest.main(testRunner=TAPTestRunner(buffer=True), exit=False)
# vim: ai sts=4 et sw=4