Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fact_pdf_report
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
fact_pdf_report
Commits
1baed6ba
Commit
1baed6ba
authored
Jul 04, 2019
by
dorp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added new test module
parent
a42d391f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
test_new_tests.py
src/test/unit/test_new_tests.py
+44
-0
No files found.
src/test/unit/test_new_tests.py
0 → 100644
View file @
1baed6ba
from
pathlib
import
Path
import
pytest
from
latex_code_generation.code_generation
import
generate_meta_data_code
from
rest_import.rest
import
create_request_url
,
request_firmware_data
from
jinja2
import
Environment
,
FileSystemLoader
class
MockResponse
:
@staticmethod
def
json
():
return
dict
()
@pytest.fixture
(
scope
=
'function'
)
def
mock_environment
():
env
=
Environment
(
block_start_string
=
"
\
BLOCK{"
,
block_end_string
=
"}"
,
variable_start_string
=
"
\
VAR{"
,
variable_end_string
=
"}"
,
comment_start_string
=
"
\
#{"
,
comment_end_string
=
"}"
,
line_statement_prefix
=
"
%%
"
,
line_comment_prefix
=
"
%#
"
,
trim_blocks
=
True
,
autoescape
=
False
,
loader
=
FileSystemLoader
(
str
(
Path
(
Path
(
__file__
)
.
parent
.
parent
.
parent
,
"templates"
,
'default'
))),
)
return
env
def
test_anything_mocked
(
monkeypatch
):
monkeypatch
.
setattr
(
'rest_import.rest.requests.get'
,
lambda
x
:
MockResponse
())
anything
=
request_firmware_data
(
'anything'
)
assert
anything
def
test_generate_meta_code
(
mock_environment
):
result
=
generate_meta_data_code
(
mock_environment
,
{})
assert
result
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment