Esempio n. 1
0
def stores_should_be_similar():
    member_store1 = store.MembersStore()
    member_store2 = store.MembersStore()
    if member_store1.get_all() is member_store2.get_all():
        print("Same stores elements !")
Esempio n. 2
0
        for post in member_with_posts.posts:
            print(f"\t{post}")

        print("=" * 10)


def store_should_get_top_two(member_store):
    top_two_members = member_store.get_top_two()

    for member_with_posts in top_two_members:
        print(f"{member_with_posts} has posts:")
        for post in member_with_posts.posts:
            print(f"\t{post}")


member_store = store.MembersStore()
post_store = store.PostsStore()

members_instances = dummy_data.dummy_members
member1, member2, member3 = members_instances

posts_instances = dummy_data.dummy_posts
post1, post2, post3, post4, post5, post6, post7, post8, post9 = posts_instances

store_should_add_members(members_instances, member_store)

stores_should_be_similar()

print_all_members(member_store)

get_by_id_should_retrieve_same_object(member_store, member2)