Skip to content

Commit

Permalink
Agrego test sobre helper nuevo
Browse files Browse the repository at this point in the history
  • Loading branch information
fcassanello committed Sep 13, 2019
1 parent 2b6486a commit 0886c52
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@

"""Tests del modulo pydatajson."""

from __future__ import unicode_literals
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement

import os.path
import unittest

import nose
import openpyxl as pyxl

from pydatajson.helpers import fields_to_uppercase
from .context import pydatajson


Expand Down Expand Up @@ -164,7 +167,6 @@ def test_parse_repeating_time_interval_to_str(self):

def test_add_dicts(self):
# Testea la función auxiliar para sumar campos de dicts recursivamente
from pydatajson.helpers import add_dicts

one_dict = {
"distribuciones_formatos_cant": {
Expand Down Expand Up @@ -221,6 +223,21 @@ def test_title_to_name(self):
"exportacion-tomates-ano-2017"
)

def test_fields_to_uppercase_returns_unique_uppercase_keys(self):
fields = {
'csv': 10,
'CSV': 20,
'json': 30,
'JSON': 40
}

expected = {
'CSV': 30,
'JSON': 70
}

self.assertEqual(fields_to_uppercase(fields), expected)


if __name__ == '__main__':
nose.run(defaultTest=__name__)

0 comments on commit 0886c52

Please sign in to comment.