summaryrefslogtreecommitdiff
path: root/subplot
diff options
context:
space:
mode:
Diffstat (limited to 'subplot')
-rw-r--r--subplot/data.py6
-rw-r--r--subplot/data.yaml3
2 files changed, 9 insertions, 0 deletions
diff --git a/subplot/data.py b/subplot/data.py
index ba3636c..a24cd0c 100644
--- a/subplot/data.py
+++ b/subplot/data.py
@@ -13,6 +13,12 @@ def create_file_with_random_data(ctx, filename=None):
f.write(data)
+def create_nonutf8_filename(ctx, dirname=None):
+ filename = "\x88"
+ os.mkdir(dirname)
+ open(filename, "wb").close()
+
+
def chmod_file(ctx, filename=None, mode=None):
os.chmod(filename, int(mode, 8))
diff --git a/subplot/data.yaml b/subplot/data.yaml
index 32c9cd5..7659319 100644
--- a/subplot/data.yaml
+++ b/subplot/data.yaml
@@ -6,6 +6,9 @@
- given: "a file {filename} containing some random data"
function: create_file_with_random_data
+- given: "a file in {dirname} with a non-UTF8 filename"
+ function: create_nonutf8_filename
+
- given: file {filename} has mode {mode}
function: chmod_file