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
57dec06f
Commit
57dec06f
authored
Feb 07, 2023
by
Mauricio Alejandro Prieto Palacios
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clase para agrupar las pruebas del filtrado del marco de datos
parent
3625bdb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
test/test_main.py
+14
-4
No files found.
test/test_main.py
View file @
57dec06f
...
...
@@ -32,7 +32,17 @@ def red_prueba():
return
red
@pytest.mark.parametrize
(
"ultima"
,
[
1
,
2
,
3
,
4
])
def
test_filtrado_correcto
(
df_prueba
,
ultima
):
df_filtrado
=
main
.
filtrar_primeras_posiciones
(
df_prueba
,
ultima_posicion
=
ultima
)
assert
df_filtrado
[
'posicion'
]
.
max
()
<=
ultima
class
TestFiltrado
:
@pytest.mark.parametrize
(
"ultima"
,
[
1
,
2
,
3
,
4
])
def
test_filtrado_correcto
(
self
,
df_prueba
,
ultima
):
df_filtrado
=
main
.
filtrar_primeras_posiciones
(
df_prueba
,
ultima_posicion
=
ultima
)
assert
df_filtrado
[
'posicion'
]
.
max
()
<=
ultima
@pytest.mark.parametrize
(
'df_falso'
,
[
'df_prueba'
,
5
,
5.0
,
True
])
def
test_sin_df
(
self
,
df_falso
):
with
pytest
.
raises
(
TypeError
):
main
.
filtrar_primeras_posiciones
(
df_falso
)
def
test_sin_columna_posicion
(
self
,
df_prueba
):
with
pytest
.
raises
(
ValueError
):
main
.
filtrar_primeras_posiciones
(
df_prueba
.
drop
(
'posicion'
,
axis
=
1
))
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