-
-
Notifications
You must be signed in to change notification settings - Fork 471
/
Copy pathimage.js
71 lines (52 loc) · 1.43 KB
/
image.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*jshint -W030 */
var expect = require('chai').expect;
var docker = require('./spec_helper').docker;
var testImage = 'ubuntu:latest';
describe("#image", function() {
describe("#inspect", function() {
it("should inspect an image", function(done) {
var image = docker.getImage(testImage);
function handler(err, data) {
expect(err).to.be.null;
expect(data).to.be.ok;
done();
}
image.inspect(handler);
});
});
describe("#distribution", function() {
it("should distribution an image", function(done) {
this.timeout(30000);
var image = docker.getImage(testImage);
function handler(err, data) {
expect(err).to.be.null;
expect(data).to.be.ok;
done();
}
image.distribution(handler);
});
});
describe("#history", function() {
it("should get image history", function(done) {
var image = docker.getImage(testImage);
function handler(err, data) {
expect(err).to.be.null;
expect(data).to.be.a('array');
done();
}
image.history(handler);
});
});
describe("#get", function() {
it("should get an image", function(done) {
this.timeout(120000);
var image = docker.getImage(testImage);
function handler(err, stream) {
expect(err).to.be.null;
expect(stream).to.be.ok;
done();
}
image.get(handler);
});
});
});