Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
redsem
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mauricio Alejandro Prieto Palacios
redsem
Commits
3625bdb5
Commit
3625bdb5
authored
Feb 07, 2023
by
Mauricio Alejandro Prieto Palacios
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alcance de fixtures
parent
ad4667dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
test/test_main.py
+4
-3
No files found.
test/test_main.py
View file @
3625bdb5
import
networkx
as
nx
import
networkx
as
nx
import
pandas
as
pd
import
pandas
as
pd
import
pytest
import
pytest
from
redsem
import
main
from
redsem
import
main
@pytest.fixture
()
@pytest.fixture
(
scope
=
'module'
)
def
df_prueba
():
def
df_prueba
():
datos
=
{
'palabras'
:
[
'prueba'
,
'para'
,
'redes'
,
'semánticas'
],
datos
=
{
'palabras'
:
[
'prueba'
,
'para'
,
'redes'
,
'semánticas'
],
'posicion'
:
[
1
,
2
,
3
,
4
]}
'posicion'
:
[
1
,
2
,
3
,
4
]}
return
pd
.
DataFrame
(
datos
)
return
pd
.
DataFrame
(
datos
)
@pytest.fixture
()
@pytest.fixture
(
scope
=
'module'
)
def
red_prueba
():
def
red_prueba
():
palabras_estimulo
=
[
'covid_semilla'
,
'obesidad_semilla'
]
palabras_estimulo
=
[
'covid_semilla'
,
'obesidad_semilla'
]
palabras_respuesta
=
[
'salud'
,
'ansiedad'
,
'higiene'
,
'comida'
]
palabras_respuesta
=
[
'salud'
,
'ansiedad'
,
'higiene'
,
'comida'
]
...
@@ -34,4 +35,4 @@ def red_prueba():
...
@@ -34,4 +35,4 @@ def red_prueba():
@pytest.mark.parametrize
(
"ultima"
,
[
1
,
2
,
3
,
4
])
@pytest.mark.parametrize
(
"ultima"
,
[
1
,
2
,
3
,
4
])
def
test_filtrado_correcto
(
df_prueba
,
ultima
):
def
test_filtrado_correcto
(
df_prueba
,
ultima
):
df_filtrado
=
main
.
filtrar_primeras_posiciones
(
df_prueba
,
ultima_posicion
=
ultima
)
df_filtrado
=
main
.
filtrar_primeras_posiciones
(
df_prueba
,
ultima_posicion
=
ultima
)
assert
len
(
df_filtrado
)
=
=
ultima
assert
df_filtrado
[
'posicion'
]
.
max
()
<
=
ultima
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