tests: Fix SMB Py binding .unlink() test case assertion
authorTim Beale <timbeale@catalyst.net.nz>
Sun, 2 Dec 2018 22:15:14 +0000 (11:15 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 12 Dec 2018 03:38:13 +0000 (04:38 +0100)
commitb84cea18fcc54f599db9580fd027b8d530d6b4bd
treefb57143fa620118e60dfc13cd48fb976ae3e95dd
parentfa77209dea48c623fa3052a65b2d8dad9f146198
tests: Fix SMB Py binding .unlink() test case assertion

The current assertion would never detect if the unlink API is broken.
The chkpath() API is only useful for checking if directories exist, so
it will always return False for a regular file (regardless of whether
the file actually exists or not).

Rework the test case so we assert that the file exists by trying to read
its contents (which will throw an error if the file doesn't exist).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/smb.py