Files
@ 71dabe761ebd
Branch filter:
Location: rattail-project/rattail/tests/test_files.py - annotation
71dabe761ebd
737 B
text/x-python
Add `Dump` command back to main module..for now.
5aaf50e5b9bc 5aaf50e5b9bc 92c03f5d8db0 92c03f5d8db0 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc 5aaf50e5b9bc | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from unittest import TestCase
import lockfile
from fixture import TempIO
from rattail import files
class TestLockingCopy(TestCase):
def setUp(self):
self.tmp = TempIO()
self.src = self.tmp.mkdir(u'src')
self.dst = self.tmp.mkdir(u'dst')
self.src_file = self.src.putfile(u'somefile', b'')
def test_normal_copy_succeeds(self):
files.locking_copy(self.src_file, self.dst)
dst_file = os.path.join(self.dst, u'somefile')
self.assertTrue(os.path.exists(dst_file))
self.assertTrue(os.path.isfile(dst_file))
self.assertFalse(os.path.exists(os.path.join(self.dst, u'somefile.lock')))
|