|
20 | 20 | from github.ContentFile import ContentFile
|
21 | 21 |
|
22 | 22 | from src import Clients, constants, exceptions, metadata, repository, run_reconcile
|
23 |
| -from src.constants import DEFAULT_BRANCH, DISCOURSE_AHEAD_TAG, DOCUMENTATION_TAG |
| 23 | +from src.constants import DEFAULT_BRANCH, DOCUMENTATION_TAG |
24 | 24 | from src.discourse import Discourse
|
25 | 25 |
|
26 | 26 | from .. import factories
|
@@ -49,16 +49,13 @@ async def test_run_conflict(
|
49 | 49 | 5. docs with an index and documentation and alternate documentation file
|
50 | 50 | 6. docs with an index and changed documentation and alternate documentation with server
|
51 | 51 | changes
|
52 |
| - 7. docs with an index and changed documentation and alternate documentation with server |
53 |
| - changes with discourse-gatekeeper/discourse-ahead-ok applied |
54 | 52 | assert: then:
|
55 | 53 | 1. the documentation page is created
|
56 | 54 | 2. the documentation page is not updated
|
57 | 55 | 3. the documentation page is not updated
|
58 | 56 | 4. the documentation page is updated
|
59 | 57 | 5. the alternate documentation page is created
|
60 | 58 | 6. the documentation page is not updated
|
61 |
| - 6. the documentation page is updated |
62 | 59 | """
|
63 | 60 | document_name = "name 1"
|
64 | 61 | caplog.set_level(logging.INFO)
|
@@ -260,7 +257,7 @@ async def test_run_conflict(
|
260 | 257 | # 6. docs with an index and changed documentation and alternate documentation with server
|
261 | 258 | # changes
|
262 | 259 | caplog.clear()
|
263 |
| - doc_file.write_text(doc_content_6 := f"# {doc_title}\ncontent 6", encoding="utf-8") |
| 260 | + doc_file.write_text(f"# {doc_title}\ncontent 6", encoding="utf-8") |
264 | 261 |
|
265 | 262 | repository_client.switch(DEFAULT_BRANCH).update_branch(
|
266 | 263 | "# 6. docs with an index and changed documentation and alternate documentation with "
|
@@ -300,34 +297,3 @@ async def test_run_conflict(
|
300 | 297 | assert doc_topic == doc_content_5
|
301 | 298 | alt_doc_topic = discourse_api.retrieve_topic(url=alt_doc_url)
|
302 | 299 | assert alt_doc_topic == alt_doc_topic_content_6
|
303 |
| - |
304 |
| - # 7. docs with an index and changed documentation and alternate documentation with server |
305 |
| - # changes with discourse-gatekeeper/discourse-ahead-ok applied |
306 |
| - caplog.clear() |
307 |
| - repository_client.tag_commit(DISCOURSE_AHEAD_TAG, repository_client.current_commit) |
308 |
| - mock_github_repo.get_contents.side_effect = [mock_alt_content_file, mock_content_file] |
309 |
| - |
310 |
| - reconcile_output = run_reconcile( |
311 |
| - clients=Clients(discourse=discourse_api, repository=repository_client), |
312 |
| - user_inputs=factories.UserInputsFactory( |
313 |
| - dry_run=False, delete_pages=True, commit_sha=repository_client.current_commit |
314 |
| - ), |
315 |
| - ) |
316 |
| - |
317 |
| - assert reconcile_output is not None |
318 |
| - urls_with_actions = reconcile_output.topics |
319 |
| - |
320 |
| - assert len(urls_with_actions) == 3 |
321 |
| - (alt_doc_url, _, _) = urls_with_actions.keys() |
322 |
| - assert (urls := tuple(urls_with_actions)) == (alt_doc_url, doc_url, index_url) |
323 |
| - assert_substrings_in_string( |
324 |
| - chain(urls, (doc_table_line_1, alt_doc_table_line_5, "Update", "'success'")), |
325 |
| - caplog.text, |
326 |
| - ) |
327 |
| - index_topic = discourse_api.retrieve_topic(url=index_url) |
328 |
| - assert doc_table_line_1 in index_topic |
329 |
| - assert alt_doc_table_line_5 in index_topic |
330 |
| - doc_topic = discourse_api.retrieve_topic(url=doc_url) |
331 |
| - assert doc_topic == doc_content_6 |
332 |
| - alt_doc_topic = discourse_api.retrieve_topic(url=alt_doc_url) |
333 |
| - assert alt_doc_topic == alt_doc_topic_content_6 |
0 commit comments