Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / fleep / 0001-Fixing-paths-on-tests.patch
blob234bf0cb379b58368f0ec9e1e85d979443d92a56
1 From 716fcfa3203bc881b543916bdb9a17460951cd26 Mon Sep 17 00:00:00 2001
2 From: "P. R. d. O" <d.ol.rod@protonmail.com>
3 Date: Fri, 26 Nov 2021 07:13:32 -0600
4 Subject: [PATCH] Fixing paths on tests
6 ---
7 tests/maintest.py | 7 ++++++-
8 tests/speedtest.py | 7 ++++++-
9 2 files changed, 12 insertions(+), 2 deletions(-)
11 diff --git a/tests/maintest.py b/tests/maintest.py
12 index 0e24ca4..3484437 100644
13 --- a/tests/maintest.py
14 +++ b/tests/maintest.py
15 @@ -1,6 +1,11 @@
16 import fleep
17 +import os
19 -with open("testfile", "rb") as file:
20 +current_dir = os.path.realpath(os.path.join(os.getcwd(),
21 + os.path.dirname(__file__)))
23 +with open(os.path.join(current_dir, "./testfile"),
24 + "rb") as file:
25 info = fleep.get(file.read(128))
27 assert info.type == ["raster-image"]
28 diff --git a/tests/speedtest.py b/tests/speedtest.py
29 index 89338ab..829d563 100644
30 --- a/tests/speedtest.py
31 +++ b/tests/speedtest.py
32 @@ -1,7 +1,12 @@
33 import time
34 import fleep
35 +import os
37 -with open("testfile", "rb") as file:
38 +current_dir = os.path.realpath(os.path.join(os.getcwd(),
39 + os.path.dirname(__file__)))
41 +with open(os.path.join(current_dir, "./testfile"),
42 + "rb") as file:
43 stream = file.read(128)
45 times = []
46 --
47 2.33.1