Skip to content

Commit 4cd1158

Browse files
committed
Add testing dir and update tests
1 parent a81f363 commit 4cd1158

File tree

7 files changed

+31
-13
lines changed

7 files changed

+31
-13
lines changed

docs/source/docset.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ toc:
4141
- file: tabs.md
4242
- file: tagged_regions.md
4343
- file: titles.md
44+
- folder: testing

docs/source/testing/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Testing
3+
---
4+
5+
The files in this directory are used for testing purposes. Do not edit these files unless you are working on tests.

docs/source/testing/req.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: "Requirements"
3+
---
4+
5+
To follow this tutorial you will need to install the following components:
6+
7+
- An installation of Elasticsearch, based on our hosted [Elastic Cloud](https://www.elastic.co/cloud) service (which includes a free trial period), or a self-hosted service that you run on your own computer. See the Install Elasticsearch section above for installation instructions.
8+
- A [Python](https://python.org) interpreter. Make sure it is a recent version, such as Python 3.8 or newer.
9+
10+
The tutorial assumes that you have no previous knowledge of Elasticsearch or general search topics, but it expects you to have a basic familiarity with the following technologies, at least at a beginner level:
11+
12+
- Python development
13+
- The [Flask](https://flask.palletsprojects.com/) web framework for Python.
14+
- The command prompt or terminal application in your operating system.

tests/Elastic.Markdown.Tests/Inline/AnchorLinkTests.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
3434
3535
To follow this tutorial you will need to install the following components:
3636
""";
37-
fileSystem.AddFile(@"docs/source/elastic/search-labs/search/req.md", inclusion);
37+
fileSystem.AddFile(@"docs/source/testing/req.md", inclusion);
3838
fileSystem.AddFile(@"docs/source/_static/img/observability.png", new MockFileData(""));
3939
}
4040

@@ -59,7 +59,7 @@ public void GeneratesHtml() =>
5959

6060
public class ExternalPageAnchorTests(ITestOutputHelper output) : AnchorLinkTestBase(output,
6161
"""
62-
[Sub Requirements](elastic/search-labs/search/req.md#sub-requirements)
62+
[Sub Requirements](testing/req.md#sub-requirements)
6363
"""
6464
)
6565
{
@@ -76,7 +76,7 @@ public void GeneratesHtml() =>
7676

7777
public class ExternalPageAnchorAutoTitleTests(ITestOutputHelper output) : AnchorLinkTestBase(output,
7878
"""
79-
[](elastic/search-labs/search/req.md#sub-requirements)
79+
[](testing/req.md#sub-requirements)
8080
"""
8181
)
8282
{
@@ -112,7 +112,7 @@ public void HasError() => Collector.Diagnostics.Should().HaveCount(1)
112112

113113
public class ExternalPageBadAnchorTests(ITestOutputHelper output) : AnchorLinkTestBase(output,
114114
"""
115-
[Sub Requirements](elastic/search-labs/search/req.md#sub-requirements2)
115+
[Sub Requirements](testing/req.md#sub-requirements2)
116116
"""
117117
)
118118
{
@@ -127,4 +127,3 @@ public void GeneratesHtml() =>
127127
public void HasError() => Collector.Diagnostics.Should().HaveCount(1)
128128
.And.Contain(d => d.Message.Contains("`sub-requirements2` does not exist"));
129129
}
130-

tests/Elastic.Markdown.Tests/Inline/DirectiveBlockLinkTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
3636
This is a 'caution' admonition
3737
```
3838
""";
39-
fileSystem.AddFile(@"docs/source/elastic/search-labs/search/req.md", inclusion);
39+
fileSystem.AddFile(@"docs/source/testing/req.md", inclusion);
4040
fileSystem.AddFile(@"docs/source/_static/img/observability.png", new MockFileData(""));
4141
}
4242

@@ -61,7 +61,7 @@ public void GeneratesHtml() =>
6161

6262
public class ExternalDirectiveLinkTests(ITestOutputHelper output) : DirectiveBlockLinkTests(output,
6363
"""
64-
[Sub Requirements](elastic/search-labs/search/req.md#hint_ref)
64+
[Sub Requirements](testing/req.md#hint_ref)
6565
"""
6666
)
6767
{
@@ -75,4 +75,3 @@ public void GeneratesHtml() =>
7575
[Fact]
7676
public void HasNoErrors() => Collector.Diagnostics.Should().HaveCount(0);
7777
}
78-

tests/Elastic.Markdown.Tests/Inline/InlineLinkTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
2727
2828
To follow this tutorial you will need to install the following components:
2929
""";
30-
fileSystem.AddFile(@"docs/source/elastic/search-labs/search/req.md", inclusion);
30+
fileSystem.AddFile(@"docs/source/testing/req.md", inclusion);
3131
fileSystem.AddFile(@"docs/source/_static/img/observability.png", new MockFileData(""));
3232
}
3333

@@ -52,7 +52,7 @@ public void GeneratesHtml() =>
5252

5353
public class LinkToPageTests(ITestOutputHelper output) : LinkTestBase(output,
5454
"""
55-
[Requirements](elastic/search-labs/search/req.md)
55+
[Requirements](testing/req.md)
5656
"""
5757
)
5858
{
@@ -69,7 +69,7 @@ public void GeneratesHtml() =>
6969

7070
public class InsertPageTitleTests(ITestOutputHelper output) : LinkTestBase(output,
7171
"""
72-
[](elastic/search-labs/search/req.md)
72+
[](testing/req.md)
7373
"""
7474
)
7575
{

tests/Elastic.Markdown.Tests/SiteMap/NavigationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ public void ParsesNestedFoldersAndPrefixesPaths()
1818
{
1919
Configuration.ImplicitFolders.Should().NotBeNullOrEmpty();
2020
Configuration.ImplicitFolders.Should()
21-
.Contain("markup")
21+
.Conta("markup")
2222
.And.Contain("elastic/observability");
2323
}
2424
[Fact]
2525
public void ParsesFilesAndPrefixesPaths() =>
2626
Configuration.Files.Should()
2727
.Contain("index.md")
28-
.And.Contain("elastic/search-labs/search/req.md");
28+
.And.Contain("testing/req.md");
2929
}

0 commit comments

Comments
 (0)