Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Commit

Permalink
Rename integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Feb 13, 2016
1 parent 6cb061d commit c647623
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 42 deletions.
20 changes: 2 additions & 18 deletions tests/test_all.py → tests/test_examples.py
Expand Up @@ -12,22 +12,19 @@
log = logging.getLogger(__name__)


# classes ######################################################################
# CLASSES ######################################################################


class EmptyDictionary(Dictionary):

"""Sample dictionary container."""


@yorm.attr(all=Integer)
class IntegerList(List):

"""Sample list container."""


class SampleStandard:

"""Sample class using standard attribute types."""

def __init__(self):
Expand All @@ -50,7 +47,6 @@ def __repr__(self):
@yorm.attr(true=Boolean, false=Boolean)
@yorm.sync("path/to/{self.category}/{self.name}.yml")
class SampleStandardDecorated:

"""Sample class using standard attribute types."""

def __init__(self, name, category='default'):
Expand All @@ -72,18 +68,15 @@ def __repr__(self):

@yorm.attr(status=Boolean, label=String)
class StatusDictionary(Dictionary):

"""Sample dictionary container."""


@yorm.attr(all=StatusDictionary)
class StatusDictionaryList(List):

"""Sample list container."""


class Level(String):

"""Sample custom attribute."""

@classmethod
Expand All @@ -100,7 +93,6 @@ def to_data(cls, obj):

@yorm.sync("path/to/directory/{UUID}.yml", attrs={'level': Level})
class SampleCustomDecorated:

"""Sample class using custom attribute types."""

def __init__(self, name):
Expand All @@ -114,7 +106,6 @@ def __repr__(self):
@yorm.attr(string=String)
@yorm.sync("sample.yml", auto=False)
class SampleDecoratedAutoOff:

"""Sample class with automatic storage turned off."""

def __init__(self):
Expand All @@ -126,15 +117,13 @@ def __repr__(self):

@yorm.sync("sample.yml")
class SampleEmptyDecorated:

"""Sample class using standard attribute types."""

def __repr__(self):
return "<empty {}>".format(id(self))


class SampleExtended:

"""Sample class using extended attribute types."""

def __init__(self):
Expand All @@ -145,7 +134,6 @@ def __repr__(self):


class SampleNested:

"""Sample class using nested attribute types."""

def __init__(self):
Expand All @@ -155,11 +143,10 @@ def __init__(self):
def __repr__(self):
return "<nested {}>".format(id(self))

# tests ########################################################################
# TESTS ########################################################################


class TestStandard:

"""Integration tests for standard attribute types."""

@yorm.attr(status=yorm.types.Boolean)
Expand Down Expand Up @@ -353,7 +340,6 @@ def test_auto_off(self, tmpdir):


class TestContainers:

"""Integration tests for attribute containers."""

def test_nesting(self, tmpdir):
Expand Down Expand Up @@ -446,7 +432,6 @@ def test_objects(self, tmpdir):


class TestExtended:

"""Integration tests for extended attribute types."""

def test_function(self, tmpdir):
Expand Down Expand Up @@ -487,7 +472,6 @@ def test_function(self, tmpdir):


class TestCustom:

"""Integration tests for custom attribute types."""

def test_decorator(self, tmpdir):
Expand Down
7 changes: 2 additions & 5 deletions tests/test_all_fake.py → tests/test_fake.py
Expand Up @@ -10,13 +10,12 @@
from . import strip


# classes ######################################################################
# CLASSES ######################################################################


@yorm.attr(value=yorm.types.standard.Integer)
@yorm.sync("path/to/{self.name}.yml")
class Sample:

"""Sample class for fake mapping."""

def __init__(self, name):
Expand All @@ -27,12 +26,11 @@ def __repr__(self):
return "<sample {}>".format(id(self))


# tests ########################################################################
# TESTS ########################################################################


@patch('yorm.settings.fake', True)
class TestFake:

"""Integration tests with `yorm.settings.fake` enabled."""

def test_no_file_create_when_fake(self, tmpdir):
Expand Down Expand Up @@ -78,7 +76,6 @@ def test_fake_changes_indicate_modified(self, tmpdir):


class TestReal:

"""Integration tests with `yorm.settings.fake` disabled."""

def test_setting_text_updates_attributes(self, tmpdir):
Expand Down
10 changes: 2 additions & 8 deletions tests/test_all_files.py → tests/test_files.py
Expand Up @@ -12,17 +12,15 @@
from . import refresh_file_modification_times


# classes ######################################################################
# CLASSES ######################################################################


class EmptyDictionary(Dictionary):

"""Sample dictionary container."""


@yorm.attr(all=Integer)
class IntegerList(List):

"""Sample list container."""


Expand All @@ -31,7 +29,6 @@ class IntegerList(List):
@yorm.attr(true=Boolean, false=Boolean)
@yorm.sync("path/to/{self.category}/{self.name}.yml")
class SampleStandardDecorated:

"""Sample class using standard attribute types."""

def __init__(self, name, category='default'):
Expand All @@ -51,11 +48,10 @@ def __repr__(self):
return "<decorated {}>".format(id(self))


# tests ########################################################################
# TESTS ########################################################################


class TestCreate:

"""Integration tests for creating mapped classes."""

def test_fetch_from_existing(self, tmpdir):
Expand Down Expand Up @@ -85,7 +81,6 @@ def test_fetch_from_existing(self, tmpdir):


class TestDelete:

"""Integration tests for deleting files."""

def test_read(self, tmpdir):
Expand Down Expand Up @@ -118,7 +113,6 @@ def test_multiple(self, tmpdir):


class TestUpdate:

"""Integration tests for updating files/object."""

def test_automatic_store_after_first_modification(self, tmpdir):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_mapped_signature.py
@@ -1,4 +1,4 @@
"""Tests to ensure a mapped object's signature remains unchanged."""
"""Integration tests to ensure a mapped object's signature remains unchanged."""
# pylint: disable=redefined-outer-name,unused-variable,expression-not-assigned

import pytest
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test_all_pm.py → tests/test_persistence_models.py
Expand Up @@ -7,7 +7,7 @@
import yorm


# classes ######################################################################
# CLASSES ######################################################################


class Config:
Expand Down Expand Up @@ -58,7 +58,7 @@ def read(self, key):
return instance


# tests ########################################################################
# TESTS ########################################################################


class TestPersistanceMapping: # pylint: disable=no-member
Expand Down
4 changes: 2 additions & 2 deletions yorm/test/test_bases_mappable.py
Expand Up @@ -41,7 +41,7 @@ def modified(self, changes):
self._mock_modified = changes


# classes ######################################################################
# CLASSES ######################################################################

@yorm.attr(all=Integer)
class IntegerList(List):
Expand Down Expand Up @@ -80,7 +80,7 @@ def __repr__(self):
return "<sample {}>".format(id(self))


# tests ########################################################################
# TESTS ########################################################################


class TestMappable:
Expand Down
4 changes: 2 additions & 2 deletions yorm/test/test_converters_containers.py
Expand Up @@ -16,7 +16,7 @@
log = logging.getLogger(__name__)


# classes ######################################################################
# CLASSES ######################################################################


@attr(abc=Integer)
Expand Down Expand Up @@ -48,7 +48,7 @@ class UnknownList(List):
"""Sample list container."""


# tests ########################################################################
# TESTS ########################################################################


class TestDictionary:
Expand Down
4 changes: 2 additions & 2 deletions yorm/test/test_converters_extended.py
Expand Up @@ -7,7 +7,7 @@
from yorm.types.extended import Markdown, AttributeDictionary, SortedList


# classes ######################################################################
# CLASSES ######################################################################


@attr(var1=Integer, var2=String)
Expand All @@ -34,7 +34,7 @@ class UnknownSortedList(SortedList):
"""Sample list container."""


# tests ########################################################################
# TESTS ########################################################################


class TestMarkdown:
Expand Down
4 changes: 2 additions & 2 deletions yorm/test/test_utilities.py
Expand Up @@ -11,7 +11,7 @@

log = logging.getLogger(__name__)

# classes ######################################################################
# CLASSES ######################################################################


class MockConverter(Converter):
Expand Down Expand Up @@ -64,7 +64,7 @@ class MockMappable(Mappable):
__mapper__.attrs = {}


# tests ########################################################################
# TESTS ########################################################################


@patch('yorm.common.write_text', Mock())
Expand Down

0 comments on commit c647623

Please sign in to comment.