Skip to content

Commit

Permalink
Add UUID tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Zarzycki committed Oct 5, 2020
1 parent 929621a commit 17cc082
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/generator/test_uuid.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import uuid

from unittest import TestCase
from unittest.mock import MagicMock, patch

from flask_seeder.generator import UUID


class TestUUIDGenerator(TestCase):
def setUp(self):
self.generator = UUID()

@patch("uuid.uuid4", return_value=0)
def test_generate_mock_uuid(self, m_uuid):
result = self.generator.generate()

assert result == 0

def test_generate_uuid(self):
result = self.generator.generate()

uuid.UUID(str(result), version=4)

0 comments on commit 17cc082

Please sign in to comment.