~ubuntu-branches/ubuntu/vivid/landscape-client/vivid

« back to all changes in this revision

Viewing changes to landscape/package/tests/test_reporter.py

  • Committer: Package Import Robot
  • Author(s): Andreas Hasenack
  • Date: 2014-11-20 21:03:56 UTC
  • mfrom: (1.1.34)
  • Revision ID: package-import@ubuntu.com-20141120210356-bdl520tpnxddxtm0
Tags: 14.11-0ubuntu1
* New upstream version:
  - Fix regression occurring when performing Landscape-driven release
    upgrades (LP: #1389686)
  - Fix regression occurring when switching the client between different
    Landscape servers (LP #376134)
  - Support reporting QEMU virtualization (LP: #1374501)
  - Bump Juju integration message format (LP: #1369635, LP: #1362506)
  - Drop provisioning registration message (LP: #1362506)
  - Drop cloud registration message (LP: #1342646)
  - Fix handling broken packages (LP: #1326940)
  - Add new Swift usage message type (LP: #1320236)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1081
1081
    def test_resynchronize(self):
1082
1082
        """
1083
1083
        When a resynchronize task arrives, the reporter should clear
1084
 
        out all the data in the package store, except the hash ids and
1085
 
        the hash ids requests.
 
1084
        out all the data in the package store, except the hash ids.
 
1085
 
1086
1086
        This is done in the reporter so that we know it happens when
1087
1087
        no other reporter is possibly running at the same time.
1088
1088
        """
1134
1134
            self.assertEqual(self.store.get_installed(), [3])
1135
1135
            self.assertEqual(self.store.get_locked(), [3])
1136
1136
 
1137
 
            # The two original hash id requests should be still there, and
1138
 
            # a new hash id request should also be detected for HASH3.
1139
 
            requests_count = 0
1140
 
            new_request_found = False
1141
 
            for request in self.store.iter_hash_id_requests():
1142
 
                requests_count += 1
1143
 
                if request.id == request1.id:
1144
 
                    self.assertEqual(request.hashes, ["hash3"])
1145
 
                elif request.id == request2.id:
1146
 
                    self.assertEqual(request.hashes, ["hash4"])
1147
 
                elif not new_request_found:
1148
 
                    self.assertEqual(request.hashes, [HASH3, HASH1])
1149
 
                else:
1150
 
                    self.fail("Unexpected hash-id request!")
1151
 
            self.assertEqual(requests_count, 3)
 
1137
            # The two original hash id requests are gone, and a new hash id
 
1138
            # request should be detected for HASH3.
 
1139
            [request] = self.store.iter_hash_id_requests()
 
1140
            self.assertEqual(request.hashes, [HASH3, HASH1])
1152
1141
 
1153
1142
        deferred.addCallback(check_result)
1154
1143
        return deferred