def test_extract_hash(self):
        # With file name
        with tempfile.NamedTemporaryFile(mode='w+') as tfile:
            tfile.write('rc.conf ef6e82e4006dee563d98ada2a2a80a27\n')
            tfile.write(
                'ead48423703509d37c4a90e6a0d53e143b6fc268 example.tar.gz\n')
            tfile.flush()
            result = filemod.extract_hash(tfile.name, '', '/rc.conf')
            self.assertEqual(result, {
                'hsum': 'ef6e82e4006dee563d98ada2a2a80a27',
                'hash_type': 'md5'
            })

            result = filemod.extract_hash(tfile.name, '', '/example.tar.gz')
            self.assertEqual(result, {
                'hsum': 'ead48423703509d37c4a90e6a0d53e143b6fc268',
                'hash_type': 'sha1'
            })
        # Solohash - no file name (Maven repo checksum file format)
        with tempfile.NamedTemporaryFile(mode='w+') as tfile:
            tfile.write('ead48423703509d37c4a90e6a0d53e143b6fc268\n')
            tfile.flush()
            result = filemod.extract_hash(tfile.name, '', '/testfile')
            self.assertEqual(result, {
                'hsum': 'ead48423703509d37c4a90e6a0d53e143b6fc268',
                'hash_type': 'sha1'
            })
Initializes the current instance of the object.
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/file_test.py/FileModuleTestCase.test_extract_hash--crossover with--dataset/ETHPy150Open Microsoft/ApplicationInsights-Python/applicationinsights/channel/contracts/Envelope.py/Envelope._initialize