Skip to content

Commit

Permalink
add a test to make sure instantiation is ok
Browse files Browse the repository at this point in the history
  • Loading branch information
ardunn committed May 15, 2019
1 parent 71ae44b commit 8c75c01
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions automatminer/tests/test_presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
import unittest

from automatminer import MatPipe
from automatminer.presets import get_preset_config

AF_KEY = "autofeaturizer"
Expand All @@ -19,31 +20,43 @@ def test_production(self):
prod = get_preset_config("production")
for k in KEYSET:
self.assertTrue(k in prod.keys())
MatPipe(**prod)

def test_debug(self):
debug = get_preset_config("debug")
for k in KEYSET:
self.assertTrue(k in debug.keys())
MatPipe(**debug)

def test_debug_single(self):
debug_single = get_preset_config("debug_single")
for k in KEYSET:
self.assertTrue(k in debug_single.keys())
MatPipe(**debug_single)

def test_express(self):
express = get_preset_config("express")
for k in KEYSET:
self.assertTrue(k in express.keys())
MatPipe(**express)

def test_express_single(self):
express_single = get_preset_config("express_single")
for k in KEYSET:
self.assertTrue(k in express_single.keys())
MatPipe(**express_single)

def test_heavy(self):
heavy = get_preset_config("heavy")
for k in KEYSET:
self.assertTrue(k in heavy.keys())
MatPipe(**heavy)

def test_caching_powerup(self):
cache_src = "./somefile.json"
prod = get_preset_config("production", cache_src=cache_src)
self.assertEqual(prod[AF_KEY].cache_src, cache_src)
MatPipe(**prod)

def test_missing(self):
with self.assertRaises(ValueError):
Expand Down

0 comments on commit 8c75c01

Please sign in to comment.