Skip to content

Commit 660ffdb

Browse files
committed
cleanup: get rid of separate tests_misc directory
These tests were specific on my private data anyway; moved them into my private package
1 parent 87c2ce3 commit 660ffdb

23 files changed

Lines changed: 63 additions & 336 deletions

β€Žpyproject.tomlβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ build-backend = "hatchling.build"
106106
only-include = [
107107
"src",
108108
"misc",
109-
"tests_misc",
110109
"doc",
111110
]
112111

β€Žruff.tomlβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,5 @@ lint.per-file-ignores."src/my/core/compat.py" = [
109109
extend-exclude = [
110110
"doc/overlays/**", # TODO clean up later?
111111
"misc/repl.py", # work in progress
112+
"old/",
112113
]

β€Žsrc/my/tests/common.pyβ€Ž

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
import os
21
from pathlib import Path
32

4-
import pytest
5-
6-
V = 'HPI_TESTS_KARLICOSS'
7-
8-
skip_if_not_karlicoss = pytest.mark.skipif(
9-
V not in os.environ,
10-
reason=f'test only works on @karlicoss data for now. Set env variable {V}=true to override.',
11-
)
12-
133

144
def hpi_repo_root() -> Path:
155
root_dir = Path(__file__).absolute().parent.parent.parent.parent
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import json
2+
from datetime import datetime, timezone
3+
4+
from my.twitter.archive import Tweet
5+
6+
7+
def test_tweet() -> None:
8+
raw = r"""
9+
{
10+
"edit_info" : {
11+
"initial" : {
12+
"editTweetIds" : [
13+
"1269253350735982592"
14+
],
15+
"editableUntil" : "2020-06-06T14:02:35.059Z",
16+
"editsRemaining" : "5",
17+
"isEditEligible" : true
18+
}
19+
},
20+
"retweeted" : false,
21+
"source" : "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>",
22+
"entities" : {
23+
"hashtags" : [ ],
24+
"symbols" : [ ],
25+
"user_mentions" : [ ],
26+
"urls" : [
27+
{
28+
"url" : "https://t.co/cnUyc7zASn",
29+
"expanded_url" : "https://beepb00p.xyz/promnesia.html",
30+
"display_url" : "beepb00p.xyz/promnesia.html",
31+
"indices" : [
32+
"44",
33+
"67"
34+
]
35+
}
36+
]
37+
},
38+
"display_text_range" : [
39+
"0",
40+
"139"
41+
],
42+
"favorite_count" : "16",
43+
"id_str" : "1269253350735982592",
44+
"truncated" : false,
45+
"retweet_count" : "2",
46+
"id" : "1269253350735982592",
47+
"possibly_sensitive" : false,
48+
"created_at" : "Sat Jun 06 13:02:35 +0000 2020",
49+
"favorited" : false,
50+
"full_text" : "Finally published the post about Promnesia: https://t.co/cnUyc7zASn\n\nA story of how our browser history is broken and my attempt to fix it!",
51+
"lang" : "en"
52+
}
53+
""".strip()
54+
t = Tweet(json.loads(raw), screen_name='whatever')
55+
assert t.permalink == 'https://twitter.com/whatever/status/1269253350735982592'
56+
assert t.dt == datetime(2020, 6, 6, 13, 2, 35, tzinfo=timezone.utc)
57+
assert (
58+
t.text
59+
== 'Finally published the post about Promnesia: https://beepb00p.xyz/promnesia.html\n\nA story of how our browser history is broken and my attempt to fix it!'
60+
)
61+
assert t.tid == '1269253350735982592'
62+
assert t.entities is not None

β€Žtests_misc/__init__.pyβ€Ž

Whitespace-only changes.

β€Žtests_misc/conftest.pyβ€Ž

Lines changed: 0 additions & 9 deletions
This file was deleted.

β€Žtests_misc/emfit.pyβ€Ž

Lines changed: 0 additions & 27 deletions
This file was deleted.

β€Žtests_misc/foursquare.pyβ€Ž

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
Β (0)