Permalink
Browse files

Well fuck me dead, it pretty much works!

  • Loading branch information...
derwentx committed Nov 14, 2017
1 parent b5ada51 commit 737f02530a144e34d09e3fcd07cf8898c0995c9b
Showing with 376 additions and 96 deletions.
  1. +37 −1 tests/test_coldata.py
  2. +1 −1 tests/test_generator.py
  3. +215 −22 woogenerator/coldata.py
  4. +117 −68 woogenerator/parsing/api.py
  5. +4 −3 woogenerator/parsing/woo.py
  6. +2 −1 woogenerator/utils/clock.py
View
@@ -6,7 +6,8 @@
from context import woogenerator
from woogenerator.coldata import (ColDataAbstract, ColDataMedia, ColDataUser,
ColDataWoo, ColDataWpPost)
ColDataWoo, ColDataWpPost, ColDataProductMeridian,
ColDataProd, ColDataWcProdCategory)
from woogenerator.utils import Registrar
from .abstract import AbstractWooGeneratorTestCase
@@ -24,6 +25,41 @@ def setUp(self):
Registrar.DEBUG_WARN = False
Registrar.DEBUG_MESSAGE = False
class TestLegacyAccordanceProd(TestColData):
coldata_class = ColDataProductMeridian
legacy_coldata_class = ColDataWoo
def test_legacy_accordance_wpapi_core_cols(self):
cols = set(self.coldata_class.get_wpapi_core_cols().keys())
legacy_cols = set(self.legacy_coldata_class.get_wpapi_core_cols().keys())
if self.debug:
print('intersect:\n%s' % pformat(cols.intersection(legacy_cols)))
print('cols - legacy_cols:\n%s' % pformat(cols.difference(legacy_cols)))
print('legacy_cols - cols:\n%s' % pformat(legacy_cols.difference(cols)))
self.assertTrue(
(legacy_cols - set(['itemsum', 'slug'])).issubset(cols),
)
class TestLegacyAccordanceCat(TestColData):
coldata_class = ColDataWcProdCategory
legacy_coldata_class = ColDataWoo
def test_legacy_accordance_category_cols(self):
cols = set(self.coldata_class.get_category_cols().keys())
legacy_cols = set(self.legacy_coldata_class.get_category_cols().keys())
if self.debug:
print('intersect:\n%s' % pformat(cols.intersection(legacy_cols)))
print('cols - legacy_cols:\n%s' % pformat(cols.difference(legacy_cols)))
print('legacy_cols - cols:\n%s' % pformat(legacy_cols.difference(cols)))
self.assertTrue(
(legacy_cols - set(['DYNCAT', 'DYNPROD', 'SCHEDULE'])).issubset(cols),
)
class TestColDataAbstract(TestColData):
def test_get_target_ancestors(self):
View
@@ -288,7 +288,7 @@ def test_dummy_populate_slave_parsers(self):
'WNF': u'1465837200',
'WNT': u'32519314800',
}.items():
self.assertEqual(first_prod[key], value)
self.assertEqual(unicode(first_prod[key]), value)
# Remember the test data is deliberately modified to remove one of the categories
self.assertEquals(
Oops, something went wrong.

0 comments on commit 737f025

Please sign in to comment.