Skip to content

Commit 6de3974

Browse files
committed
Misc stuff.
- Legacy-Id: 9954
1 parent a23846c commit 6de3974

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@
3030
/lib
3131
/share
3232
/include
33+
/static
3334
/latest-coverage.json

ietf/utils/tests.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# -*- coding: utf-8 -*-
22
import os.path
3+
#import json
4+
#from pathlib import Path
35

46
from textwrap import dedent
57
from email.mime.text import MIMEText
@@ -9,6 +11,8 @@
911
from django.conf import settings
1012
from django.test import TestCase
1113

14+
import debug # pyflakes:ignore
15+
1216
from ietf.utils.management.commands import pyflakes
1317
from ietf.utils.mail import send_mail_text, send_mail_mime, outbox
1418

@@ -59,3 +63,31 @@ def send_complex_mail(to):
5963
len_before = len(outbox)
6064
send_complex_mail('good@example.com,poison@example.com')
6165
self.assertEqual(len(outbox),len_before+2)
66+
67+
68+
69+
70+
## One might think that the code below would work, but it doesn't ...
71+
72+
# def list_static_files(path):
73+
# r = Path(settings.STATIC_ROOT)
74+
# p = r / path
75+
# files = list(p.glob('**/*'))
76+
# relfn = [ str(file.relative_to(r)) for file in files ]
77+
# return relfn
78+
#
79+
# class TestBowerStaticFiles(TestCase):
80+
#
81+
# def test_bower_static_file_finder(self):
82+
# from django.templatetags.static import static
83+
# bower_json = os.path.join(settings.BASE_DIR, 'bower.json')
84+
# with open(bower_json) as file:
85+
# bower_info = json.load(file)
86+
# for asset in bower_info["dependencies"]:
87+
# files = list_static_files(asset)
88+
# self.assertGreater(len(files), 0)
89+
# for file in files:
90+
# url = static(file)
91+
# debug.show('url')
92+
# r = self.client.get(url)
93+
# self.assertEqual(r.status_code, 200)

release-coverage.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17549,6 +17549,7 @@
1754917549
"ietf/utils/management/commands/import_htpasswd": 0.0,
1755017550
"ietf/utils/management/commands/makefixture": 0.0,
1755117551
"ietf/utils/management/commands/pyflakes": 0.6027397260273972,
17552+
"ietf/utils/bower_storage": 0.0,
1755217553
"ietf/utils/markup_txt": 1.0,
1755317554
"ietf/utils/ordereddict": 1.0,
1755417555
"ietf/utils/pipe": 0.875,
@@ -18579,4 +18580,4 @@
1857918580
}
1858018581
},
1858118582
"version": "6.2.0"
18582-
}
18583+
}

0 commit comments

Comments
 (0)