Repository: matheuscas/pycpfcnpj

Issue:
Generates numbers with punctuation marks
After the release 1.1, that handles input numbers with punctuation marks, it would be also nice generate numbers with correct punctuation marks to each type of number, CPF and CNPJ. 

Discussion:

Patch:
diff --git a/README.md b/README.md
index 2bb5252..9bbf26f 100644
--- a/README.md
+++ b/README.md
@@ -58,6 +58,19 @@ Expected output:
 >>> 49384063495
 >>> 20788274885880
 ```
+
+And you also can generate CPF or CǸPJ with punctuation marks. :)
+
+```python
+from pycpfcnpj import gen
+gen.cpf_with_punctuation()
+gen.cnpj_with_punctuation()
+
+Expected output:
+>>> 048.891.866-97
+>>> 63.212.638/0361-35
+```
+
 Have fun!
 
 In portuguese:
@@ -108,6 +121,19 @@ Expected output:
 >>> 20788274885880
 ```
 
+E você também pode gerar CPF ou CNPJ com pontuação :)
+
+```python
+from pycpfcnpj import gen
+gen.cpf_with_punctuation()
+gen.cnpj_with_punctuation()
+
+Expected output:
+>>> 048.891.866-97
+>>> 63.212.638/0361-35
+```
+
+
 Divirta-se!
 
 Changelog
@@ -118,3 +144,6 @@ Changelog
 
 1.2
 - Use `sys` rather than `six` to check python's version and keeps this project 100% free of dependencies.
+
+1.3
+- Generate CPF and CNPJ numbers with punctuation marks.
\ No newline at end of file
diff --git a/pycpfcnpj/gen.py b/pycpfcnpj/gen.py
index 4f86ffa..2b47d44 100644
--- a/pycpfcnpj/gen.py
+++ b/pycpfcnpj/gen.py
@@ -16,3 +16,13 @@ def cnpj():
     while not cnpj_module.validate(cnpj_ramdom):
         cnpj_ramdom = ''.join(random.choice(string.digits) for i in range(14))
     return cnpj_ramdom
+
+
+def cpf_with_punctuation():
+	cpf_ramdom = cpf()
+	return '{}.{}.{}-{}'.format(cpf_ramdom[:3], cpf_ramdom[3:6], cpf_ramdom[6:9], cpf_ramdom[9:])
+
+
+def cnpj_with_punctuation():
+	cnpj_ramdom = cnpj()
+	return '{}.{}.{}/{}-{}'.format(cnpj_ramdom[:2], cnpj_ramdom[2:5], cnpj_ramdom[5:8], cnpj_ramdom[8:12], cnpj_ramdom[12:])
\ No newline at end of file


Test patch:
diff --git a/tests/gen_test.py b/tests/gen_test.py
new file mode 100644
index 0000000..a2933a9
--- /dev/null
+++ b/tests/gen_test.py
@@ -0,0 +1,27 @@
+import unittest
+from pycpfcnpj import gen, cpf, cnpj
+
+class GenerateCPFTest(unittest.TestCase):
+	"""docstring for GenerateCPFTest"""
+	def setUp(self):
+		self.masked_valid_cpf = gen.cpf_with_punctuation()
+
+	def test_validate_masked_cnpj_true(self):
+		self.assertTrue(cpf.validate(self.masked_valid_cpf))
+
+	def test_valif_cpf_without_mask_true(self):
+		cpf_result =(self.masked_valid_cpf.replace(".","")).replace("-","")
+		self.assertTrue(cpf.validate(cpf_result))
+
+
+class GenerateCNPJTest(unittest.TestCase):
+	"""docstring for GenerateCNPJTest"""
+	def setUp(self):
+		self.masked_valid_cnpj = gen.cnpj_with_punctuation()
+
+	def test_validate_masked_cnpj_true(self):
+		self.assertTrue(cnpj.validate(self.masked_valid_cnpj))
+
+	def test_valid_cnpj_without_mask_true(self):
+		cnpj_result =(self.masked_valid_cnpj.replace(".","")).replace("-","")
+		self.assertTrue(cnpj.validate(cnpj_result))
\ No newline at end of file