-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest_fetch.py
More file actions
34 lines (26 loc) · 1017 Bytes
/
Copy pathtest_fetch.py
File metadata and controls
34 lines (26 loc) · 1017 Bytes
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
from __future__ import unicode_literals
import os.path
import unittest
import sys
from https_everywhere._fetch import fetch_channel_ts, fetch_update, _storage_location
from https_everywhere._rules import _reduce_rules, clear_data, _get_rulesets
class TestFetch(unittest.TestCase):
def setUp(self):
clear_data()
def test_storage_location(self):
rv = _storage_location()
if sys.platform == "win32":
self.assertTrue(rv.endswith("https-everywhere-py\\Cache"))
elif sys.platform == "darwin":
self.assertTrue(rv.endswith("/Caches/https-everywhere-py"))
else:
self.assertEqual(rv, os.path.expanduser("~/.cache/https-everywhere-py"))
def test_channel_timestamp(self):
rv = fetch_channel_ts()
self.assertIsNotNone(rv)
def test_channel_fetch(self):
rv = fetch_update(fetch_channel_ts())
self.assertIsNotNone(rv)
_reduce_rules(rv)
def test_get_rulesets(self):
_get_rulesets()