| Total Complexity | 4 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import pytest |
||
| 2 | |||
| 3 | |||
| 4 | @pytest.fixture |
||
| 5 | def dataset_without_feature_vectors(somagic, test_datapoints): |
||
| 6 | return somagic.dataset |
||
| 7 | |||
| 8 | |||
| 9 | @pytest.fixture |
||
| 10 | def som_factory_infra(): |
||
| 11 | from so_magic.som.factory import SelfOrganizingMapFactory |
||
| 12 | from so_magic.som.self_organising_map import NoFeatureVectorsError |
||
| 13 | return { |
||
| 14 | 'factory_method': SelfOrganizingMapFactory().create, |
||
| 15 | 'no_feature_vectors_error': NoFeatureVectorsError |
||
| 16 | } |
||
| 17 | |||
| 18 | |||
| 19 | def test_create_method(dataset_without_feature_vectors, som_factory_infra): |
||
| 20 | with pytest.raises(som_factory_infra['no_feature_vectors_error'], |
||
| 21 | match='Attempted to train a Som model, but did not find feature vectors in the dataset.'): |
||
| 22 | som_factory_infra['factory_method'](dataset_without_feature_vectors, 5, 4) |
||
| 23 |