summaryrefslogtreecommitdiff
path: root/tests/sample_files
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2023-04-25 04:03:48 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2023-04-25 04:03:48 -0600
commit1b2d6aff6ccf72fdb292a1f05bb41bf9633a8f55 (patch)
tree435d5752fc5c50a3453e550c7f95f85b70d8ad2a /tests/sample_files
parent42a135329e69360745294e7bcdd4261318aeafc0 (diff)
refactor tests and add more typing
Diffstat (limited to 'tests/sample_files')
-rw-r--r--tests/sample_files/__init__.py0
-rw-r--r--tests/sample_files/checksum.txt1
-rw-r--r--tests/sample_files/config/__init__.py0
-rw-r--r--tests/sample_files/config/default.yaml23
-rw-r--r--tests/sample_files/config/default_missing_dirs.yaml17
-rw-r--r--tests/sample_files/config/default_missing_mandatory_key.yaml24
-rw-r--r--tests/sample_files/config/default_missing_root_dir.yaml18
-rw-r--r--tests/sample_files/config/multiple_default.yaml45
-rw-r--r--tests/sample_files/config/multiple_default_one_doc_error.yaml39
-rw-r--r--tests/sample_files/md/__init__.py0
-rw-r--r--tests/sample_files/md/a/__init__.py0
-rw-r--r--tests/sample_files/md/a/second.md12
-rw-r--r--tests/sample_files/md/first.md10
-rw-r--r--tests/sample_files/md/new.md10
14 files changed, 199 insertions, 0 deletions
diff --git a/tests/sample_files/__init__.py b/tests/sample_files/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/sample_files/__init__.py
diff --git a/tests/sample_files/checksum.txt b/tests/sample_files/checksum.txt
new file mode 100644
index 0000000..025b879
--- /dev/null
+++ b/tests/sample_files/checksum.txt
@@ -0,0 +1 @@
+The content of this file is irrelevant as it is only to test the checksum function. \ No newline at end of file
diff --git a/tests/sample_files/config/__init__.py b/tests/sample_files/config/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/sample_files/config/__init__.py
diff --git a/tests/sample_files/config/default.yaml b/tests/sample_files/config/default.yaml
new file mode 100644
index 0000000..08121a6
--- /dev/null
+++ b/tests/sample_files/config/default.yaml
@@ -0,0 +1,23 @@
+%YAML 1.2
+---
+define: &root "$PYSSG_HOME/pyssg/site_example/"
+
+title: "Example site"
+path:
+ src: !join [*root, "src"]
+ dst: !join [*root, "dst"]
+ plt: !join [*root, "plt"]
+ db: !join [*root, ".files"]
+url:
+ main: "https://example.com"
+fmt:
+ date: "%a, %b %d, %Y @ %H:%M %Z"
+dirs:
+ /:
+ cfg:
+ plt: "page.html"
+ tags: False
+ index: False
+ rss: False
+ sitemap: False
+... \ No newline at end of file
diff --git a/tests/sample_files/config/default_missing_dirs.yaml b/tests/sample_files/config/default_missing_dirs.yaml
new file mode 100644
index 0000000..03ee35a
--- /dev/null
+++ b/tests/sample_files/config/default_missing_dirs.yaml
@@ -0,0 +1,17 @@
+%YAML 1.2
+---
+define: &root "$PYSSG_HOME/pyssg/site_example/"
+
+title: "Example site"
+path:
+ src: !join [*root, "src"]
+ dst: !join [*root, "dst"]
+ plt: !join [*root, "plt"]
+ db: !join [*root, ".files"]
+url:
+ main: "https://example.com"
+fmt:
+ date: "%a, %b %d, %Y @ %H:%M %Z"
+dirs:
+# test missing dirs (doesn't have any)
+... \ No newline at end of file
diff --git a/tests/sample_files/config/default_missing_mandatory_key.yaml b/tests/sample_files/config/default_missing_mandatory_key.yaml
new file mode 100644
index 0000000..b5554f7
--- /dev/null
+++ b/tests/sample_files/config/default_missing_mandatory_key.yaml
@@ -0,0 +1,24 @@
+%YAML 1.2
+---
+define: &root "$PYSSG_HOME/pyssg/site_example/"
+
+# test missing mandatory key
+# title: "Example site"
+path:
+ src: !join [*root, "src"]
+ dst: !join [*root, "dst"]
+ plt: !join [*root, "plt"]
+ db: !join [*root, ".files"]
+url:
+ main: "https://example.com"
+fmt:
+ date: "%a, %b %d, %Y @ %H:%M %Z"
+dirs:
+ /:
+ cfg:
+ plt: "page.html"
+ tags: False
+ index: False
+ rss: False
+ sitemap: False
+... \ No newline at end of file
diff --git a/tests/sample_files/config/default_missing_root_dir.yaml b/tests/sample_files/config/default_missing_root_dir.yaml
new file mode 100644
index 0000000..896e141
--- /dev/null
+++ b/tests/sample_files/config/default_missing_root_dir.yaml
@@ -0,0 +1,18 @@
+%YAML 1.2
+---
+define: &root "$PYSSG_HOME/pyssg/site_example/"
+
+title: "Example site"
+path:
+ src: !join [*root, "src"]
+ dst: !join [*root, "dst"]
+ plt: !join [*root, "plt"]
+ db: !join [*root, ".files"]
+url:
+ main: "https://example.com"
+fmt:
+ date: "%a, %b %d, %Y @ %H:%M %Z"
+dirs:
+# test missing "/" dir in specific
+ something:
+... \ No newline at end of file
diff --git a/tests/sample_files/config/multiple_default.yaml b/tests/sample_files/config/multiple_default.yaml
new file mode 100644
index 0000000..54954b1
--- /dev/null
+++ b/tests/sample_files/config/multiple_default.yaml
@@ -0,0 +1,45 @@
+%YAML 1.2
+---
+define: &root "$PYSSG_HOME/pyssg/site_example/"
+
+title: "Example site"
+path:
+ src: !join [*root, "src"]
+ dst: !join [*root, "dst"]
+ plt: !join [*root, "plt"]
+ db: !join [*root, ".files"]
+url:
+ main: "https://example.com"
+fmt:
+ date: "%a, %b %d, %Y @ %H:%M %Z"
+dirs:
+ /:
+ cfg:
+ plt: "page.html"
+ tags: False
+ index: False
+ rss: False
+ sitemap: False
+...
+---
+define: &root "$PYSSG_HOME/pyssg/site_example/"
+
+title: "Example site"
+path:
+ src: !join [*root, "src"]
+ dst: !join [*root, "dst"]
+ plt: !join [*root, "plt"]
+ db: !join [*root, ".files"]
+url:
+ main: "https://example.com"
+fmt:
+ date: "%a, %b %d, %Y @ %H:%M %Z"
+dirs:
+ /:
+ cfg:
+ plt: "page.html"
+ tags: False
+ index: False
+ rss: False
+ sitemap: False
+... \ No newline at end of file
diff --git a/tests/sample_files/config/multiple_default_one_doc_error.yaml b/tests/sample_files/config/multiple_default_one_doc_error.yaml
new file mode 100644
index 0000000..44d9beb
--- /dev/null
+++ b/tests/sample_files/config/multiple_default_one_doc_error.yaml
@@ -0,0 +1,39 @@
+%YAML 1.2
+---
+define: &root "$PYSSG_HOME/pyssg/site_example/"
+
+title: "Example site"
+path:
+ src: !join [*root, "src"]
+ dst: !join [*root, "dst"]
+ plt: !join [*root, "plt"]
+ db: !join [*root, ".files"]
+url:
+ main: "https://example.com"
+fmt:
+ date: "%a, %b %d, %Y @ %H:%M %Z"
+dirs:
+ /:
+ cfg:
+ plt: "page.html"
+ tags: False
+ index: False
+ rss: False
+ sitemap: False
+...
+---
+define: &root "$PYSSG_HOME/pyssg/site_example/"
+
+title: "Example site"
+path:
+ src: !join [*root, "src"]
+ dst: !join [*root, "dst"]
+ plt: !join [*root, "plt"]
+ db: !join [*root, ".files"]
+url:
+ main: "https://example.com"
+fmt:
+ date: "%a, %b %d, %Y @ %H:%M %Z"
+dirs:
+ # just removing all paths as it will cause an error
+... \ No newline at end of file
diff --git a/tests/sample_files/md/__init__.py b/tests/sample_files/md/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/sample_files/md/__init__.py
diff --git a/tests/sample_files/md/a/__init__.py b/tests/sample_files/md/a/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/sample_files/md/a/__init__.py
diff --git a/tests/sample_files/md/a/second.md b/tests/sample_files/md/a/second.md
new file mode 100644
index 0000000..cb4e333
--- /dev/null
+++ b/tests/sample_files/md/a/second.md
@@ -0,0 +1,12 @@
+title: Second blog post for testing purposes
+author: David Luévano
+ Someone Else
+lang: en
+summary: This is just a post used for testing (the second).
+tags: test
+ english
+ short
+ update
+ multiple-author
+
+A second "blog entry" for testing purposes which uses multiple authors and is inside a subdirectory.
diff --git a/tests/sample_files/md/first.md b/tests/sample_files/md/first.md
new file mode 100644
index 0000000..567ea3e
--- /dev/null
+++ b/tests/sample_files/md/first.md
@@ -0,0 +1,10 @@
+title: First blog post for testing purposes
+author: David Luévano
+lang: en
+summary: This is just a post used for testing.
+tags: test
+ english
+ short
+ update
+
+Even though I have this "blog" subdomain and page setup, doesn't mean I'll be blogging for pyssg, this is just to serve as an example for the types of sites that pyssg can be used for. \ No newline at end of file
diff --git a/tests/sample_files/md/new.md b/tests/sample_files/md/new.md
new file mode 100644
index 0000000..ce684a7
--- /dev/null
+++ b/tests/sample_files/md/new.md
@@ -0,0 +1,10 @@
+title: New file
+author: David Luévano
+lang: en
+summary: New file used for testing the database.
+tags: test
+ english
+ short
+ update
+
+This is a sample markdown file used for testing pyssg. \ No newline at end of file