|
9 | 9 |
|
10 | 10 | from coding_study.application.about import read_about, read_license_texts |
11 | 11 | from coding_study.domain.about import ( |
| 12 | + AUTHOR_NAME, |
12 | 13 | LICENSE_NAME, |
13 | 14 | SPONSOR_LINKS, |
14 | 15 | WEBSITE, |
@@ -64,6 +65,23 @@ def sections(notice: str | None = NOTICE): |
64 | 65 | return {section.title: section for section in read_about("1.2.3", FakePackages(notice)).credits} |
65 | 66 |
|
66 | 67 |
|
| 68 | +def test_about_names_the_author(): |
| 69 | + assert read_about("1.2.3", FakePackages()).author.name == AUTHOR_NAME == "Bastian Kuberek" |
| 70 | + |
| 71 | + |
| 72 | +def test_the_author_link_reads_bkuberek_com(): |
| 73 | + assert read_about("1.2.3", FakePackages()).author.link.label == "bkuberek.com" |
| 74 | + |
| 75 | + |
| 76 | +def test_the_author_link_carries_static_utm_tags_only(): |
| 77 | + url = read_about("1.2.3", FakePackages()).author.link.url |
| 78 | + assert url == "https://bkuberek.com/?utm_source=cstudy&utm_medium=app&utm_campaign=about" |
| 79 | + |
| 80 | + |
| 81 | +def test_the_author_link_carries_nothing_of_the_version(): |
| 82 | + assert "1.2.3" not in read_about("1.2.3", FakePackages()).author.link.url |
| 83 | + |
| 84 | + |
67 | 85 | def test_about_names_the_version_it_is_given(): |
68 | 86 | assert read_about("1.2.3", FakePackages()).version == "1.2.3" |
69 | 87 |
|
@@ -102,7 +120,7 @@ def test_about_offers_the_sponsor_links(): |
102 | 120 |
|
103 | 121 | def test_every_link_is_https(): |
104 | 122 | about = read_about("1.2.3", FakePackages()) |
105 | | - links = (about.website, *about.links, *about.sponsor) |
| 123 | + links = (about.author.link, about.website, *about.links, *about.sponsor) |
106 | 124 | assert all(link.url.startswith("https://") for link in links) |
107 | 125 |
|
108 | 126 |
|
|
0 commit comments